#include <object.h>
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 Info * | typeInfo () 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 Object * | clone (bool deepCopy=false) const |
Hidded so that Object::Info items cannot be cloned. | |
Friends | |
const Info * | Object::typeInfoFactory (const string &typeName) |
Grant class Object the ability to create instances of Object::Info. |
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.
container::Object::Info::Info | ( | const string & | type_Name | ) | [private] |
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 }
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.
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 }
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.
const Object::Info *const container::Object::Info::TYPE_INFO = Object::typeInfoFactory("Object::Info") [static] |
Reimplemented from container::Object.
const string container::Object::Info::typeName |