Orxonox
0.0.5 Codename: Arcturus
|
The SubclassIdentifier acts almost like an Identifier, but has some prerequisites. More...
#include </home/jenkins/workspace/orxonox_doxygen_trunk/src/libraries/core/class/SubclassIdentifier.h>
Public Member Functions | |
SubclassIdentifier () | |
Constructor: Automaticaly assigns the Identifier of the given class. More... | |
SubclassIdentifier (Identifier *identifier) | |
Constructor: Assigns the given Identifier. More... | |
template<class O > | |
SubclassIdentifier (const SubclassIdentifier< O > &identifier) | |
Copyconstructor: Assigns the identifier of another SubclassIdentifier. More... | |
T * | fabricate (Context *context) const |
Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T. More... | |
Identifier * | getIdentifier () const |
Returns the assigned identifier. More... | |
operator Identifier * () const | |
Returns the assigned identifier. This allows you to assign a SubclassIdentifier to a normal Identifier*. More... | |
Identifier * | operator* () const |
Overloading of the * operator: returns the assigned identifier. More... | |
Identifier * | operator-> () const |
Overloading of the -> operator: returns the assigned identifier. More... | |
SubclassIdentifier< T > & | operator= (Identifier *identifier) |
Overloading of the = operator: assigns the identifier and checks its type. More... | |
template<class O > | |
SubclassIdentifier< T > & | operator= (const SubclassIdentifier< O > &identifier) |
Overloading of the = operator: assigns the identifier of another SubclassIdentifier. More... | |
Private Attributes | |
Identifier * | identifier_ |
The assigned identifier. More... | |
The SubclassIdentifier acts almost like an Identifier, but has some prerequisites.
You can only assign an Identifier that belongs to a class T (or derived) to a SubclassIdentifier<T>. If you assign something else, the program prints an error.
Because we know the base-type, a dynamic_cast
is done, which makes it easier to create a new object.
|
inline |
Constructor: Automaticaly assigns the Identifier of the given class.
|
inline |
Constructor: Assigns the given Identifier.
|
inline |
Copyconstructor: Assigns the identifier of another SubclassIdentifier.
|
inline |
Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T.
|
inline |
Returns the assigned identifier.
|
inline |
Returns the assigned identifier. This allows you to assign a SubclassIdentifier to a normal Identifier*.
|
inline |
Overloading of the * operator: returns the assigned identifier.
|
inline |
Overloading of the -> operator: returns the assigned identifier.
|
inline |
Overloading of the = operator: assigns the identifier and checks its type.
identifier | The Identifier to assign |
|
inline |
Overloading of the = operator: assigns the identifier of another SubclassIdentifier.
|
private |
The assigned identifier.