#include <src/core/Identifier.h>
Public Member Functions | |
T * | fabricate (BaseObject *creator) const |
Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T. | |
Identifier * | getIdentifier () const |
Returns the assigned identifier. | |
operator Identifier * () const | |
Returns the assigned identifier. This allows you to assign a SubclassIdentifier to a normal Identifier*. | |
Identifier * | operator* () const |
Overloading of the * operator: returns the assigned identifier. | |
Identifier * | operator-> () const |
Overloading of the -> operator: returns the assigned identifier. | |
SubclassIdentifier< T > & | operator= (Identifier *identifier) |
Overloading of the = operator: assigns the identifier and checks its type. | |
SubclassIdentifier (Identifier *identifier) | |
Copyconstructor: Assigns the given Identifier. | |
SubclassIdentifier () | |
Constructor: Automaticaly assigns the Identifier of the given class. | |
Private Attributes | |
Identifier * | identifier_ |
Returns true, if the assigned identifier is at least of the given type. |
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 aborts. Because we know the minimum type, a dynamic_cast is done, which makes it easier to create a new object.
orxonox::SubclassIdentifier< T >::SubclassIdentifier | ( | ) | [inline] |
Constructor: Automaticaly assigns the Identifier of the given class.
orxonox::SubclassIdentifier< T >::SubclassIdentifier | ( | Identifier * | identifier | ) | [inline] |
T* orxonox::SubclassIdentifier< T >::fabricate | ( | BaseObject * | creator | ) | const [inline] |
Creates a new object of the type of the assigned Identifier and dynamic_casts it to the minimal type given by T.
Referenced by orxonox::WeaponSystem::getMunition().
Identifier* orxonox::SubclassIdentifier< T >::getIdentifier | ( | ) | const [inline] |
Returns the assigned identifier.
Referenced by orxonox::WeaponSystem::getMunition(), orxonox::OrxonoxClass::isA(), orxonox::OrxonoxClass::isChildOf(), orxonox::OrxonoxClass::isDirectChildOf(), orxonox::OrxonoxClass::isDirectParentOf(), orxonox::OrxonoxClass::isExactlyA(), and orxonox::OrxonoxClass::isParentOf().
orxonox::SubclassIdentifier< T >::operator Identifier * | ( | ) | const [inline] |
Returns the assigned identifier. This allows you to assign a SubclassIdentifier to a normal Identifier*.
Identifier* orxonox::SubclassIdentifier< T >::operator* | ( | ) | const [inline] |
Overloading of the * operator: returns the assigned identifier.
Identifier* orxonox::SubclassIdentifier< T >::operator-> | ( | ) | const [inline] |
Overloading of the -> operator: returns the assigned identifier.
SubclassIdentifier<T>& orxonox::SubclassIdentifier< T >::operator= | ( | Identifier * | identifier | ) | [inline] |
Overloading of the = operator: assigns the identifier and checks its type.
identifier | The Identifier to assign |
Identifier* orxonox::SubclassIdentifier< T >::identifier_ [private] |
Returns true, if the assigned identifier is at least of the given type.
identifier | The identifier to compare with Returns true, if the assigned identifier is exactly of the given type. | |
identifier | The identifier to compare with Returns true, if the assigned identifier is a child of the given identifier. | |
identifier | The identifier to compare with Returns true, if the assigned identifier is a direct child of the given identifier. | |
identifier | The identifier to compare with Returns true, if the assigned identifier is a parent of the given identifier. | |
identifier | The identifier to compare with Returns true, if the assigned identifier is a direct parent of the given identifier. | |
identifier | The identifier to compare with The assigned identifier |