container::Object::Info Class Reference

Metadata that describes type Object or a descendant there of. More...

#include <object.h>

Inheritance diagram for container::Object::Info:

Inheritance graph
[legend]
Collaboration diagram for container::Object::Info:

Collaboration graph
[legend]

List of all members.

Public Member Functions

virtual ~Info ()
 Destructor not used.
virtual ostream & renderState (ostream &os) const
 Write the state of an Object for debugging and demonstration.
virtual const InfotypeInfo () const
 Return the instance of Object::Info that describes its own class.

Public Attributes

const string typeName

Static Public Attributes

static const Info *const TYPE_INFO = Object::typeInfoFactory("Object::Info")

Private Member Functions

 Info (const string &type_Name)
 The only constructor that is used to create instances of Info.
 Info ()
 Constructor not used.
 Info (const Info &orig)
 Constructor not used.
virtual Objectclone (bool deepCopy=false) const
 Hidded so that Object::Info items cannot be cloned.

Friends

const InfoObject::typeInfoFactory (const string &typeName)
 Grant class Object the ability to create instances of Object::Info.


Detailed Description

Metadata that describes type Object or a descendant there of.

Instantiation of Object::Info is controlled by the protected method Object::typeInfoFactory(const string&). Each sub-classes of Object should create one and only one instance of Object::Info.


Constructor & Destructor Documentation

container::Object::Info::Info ( const string &  type_Name  )  [private]

The only constructor that is used to create instances of Info.

Only Object::typeInfoFacotry is granted access.

00098 : typeName(type_Name) { }

container::Object::Info::Info (  )  [private]

Constructor not used.

00100                 : typeName(NULL) {
00101    /* not used */
00102    std::cerr << "Warning: Object::Info::Info() should not be used." << std::endl;
00103 }

container::Object::Info::Info ( const Info orig  )  [private]

Constructor not used.

00105                                          : typeName(NULL) {
00106    /* not used */
00107    std::cerr << "Warning: Object::Info::Info(const Object::Info& pattern) should not be used."
00108          << std::endl;
00109 }

container::Object::Info::~Info (  )  [virtual]

Destructor not used.

Destructor is private which prevents Object::Info from being inherited.

00111                   {
00112    /* not used */
00113    std::cerr << "Warning: Object::Info::~Info() should not be used." << std::endl;
00114 }


Member Function Documentation

Object * container::Object::Info::clone ( bool  deepCopy = false  )  const [private, virtual]

Hidded so that Object::Info items cannot be cloned.

Implements container::Object.

00126                                              {
00127    std::cerr << "Cloning an " << TYPE_INFO->typeName << " is not allowed." << std::endl;
00128    return NULL;
00129 }

ostream & container::Object::Info::renderState ( ostream &  os  )  const [virtual]

Write the state of an Object for debugging and demonstration.

This method must not change the state of an Object; adding or removing debug statements should not change the behavior of a class. The implementation must be robust, e.g., NULL safe, etc. and work without an unrecoverable error for any state, excluding an Object's time of construction and destruction. It is not required for the implementation to be thread safe.

Precondition:
The Object has been fully constructed and is not in the process of destruction
Postcondition:
The state of the Object is unchanged

Reimplemented from container::Object.

00122                                                   {
00123    return os << Object::Info::TYPE_INFO->typeName << " typeName(" << typeName << ')';
00124 }

const Object::Info * container::Object::Info::typeInfo (  )  const [virtual]

Return the instance of Object::Info that describes its own class.

Reimplemented from container::Object.

00118                                              {
00119    return Object::Info::TYPE_INFO;
00120 }


Friends And Related Function Documentation

const Info* Object::typeInfoFactory ( const string &  typeName  )  [friend]

Grant class Object the ability to create instances of Object::Info.

Class Object::Info is publically available for reference by clients of the container framework; however, all constructors are private. Method Object::typeInfoFactory(const string&) is granted the right to create instances, and it is a protected member of class Object. Sub-classes are expected to make one and only one instance of class Object::Info (a static member) to describe themselves.


Member Data Documentation

const Object::Info *const container::Object::Info::TYPE_INFO = Object::typeInfoFactory("Object::Info") [static]

Reimplemented from container::Object.


The documentation for this class was generated from the following files:

Generated on Tue Jun 16 23:13:00 2009 by  doxygen 1.5.9