37 #ifndef _Identifiable_H__ 38 #define _Identifiable_H__ 65 bool isDirectChildOf(
const Identifier* identifier);
67 bool isDirectParentOf(
const Identifier* identifier);
71 {
return this->isA(*identifier); }
74 {
return this->isExactlyA(*identifier); }
77 {
return this->isChildOf(*identifier); }
80 {
return this->isDirectChildOf(*identifier); }
83 {
return this->isParentOf(*identifier); }
86 {
return this->isDirectParentOf(*identifier); }
104 for (
int i = this->objectPointers_.size() - 1; i >= 0; --i)
106 if (this->objectPointers_[i].first == classID)
107 return this->objectPointers_[i].second;
114 {
return static_cast<T*
>(this->getDerivedPointer(classID)); }
117 {
return const_cast<Identifiable*
>(
this)->getDerivedPointer<T>(classID); }
Identifier * identifier_
The Identifier of the object.
Definition: Identifiable.h:120
Identifier * getIdentifier() const
Returns the Identifier of the object.
Definition: Identifiable.h:60
The ClassIdentifier is derived from Identifier and holds all class-specific functions and variables t...
Definition: Identifier.h:262
ORX_FORCEINLINE T * getDerivedPointer(unsigned int classID)
Version of getDerivedPointer with template.
Definition: Identifiable.h:113
Shared library macros, enums, constants and forward declarations for the core library ...
std::vector< std::pair< unsigned int, void * > > objectPointers_
'Fast map' that holds this-pointers of all derived types
Definition: Identifiable.h:123
ORX_FORCEINLINE const T * getDerivedPointer(unsigned int classID) const
Const version of getDerivedPointer with template.
Definition: Identifiable.h:116
bool isChildOf(const SubclassIdentifier< B > *identifier)
Returns true if the object's class is a child of the given type.
Definition: Identifiable.h:76
Identifiable is needed to create the class-hierarchy at startup and to store the Identifier.
Definition: Identifiable.h:50
bool isParentOf(const SubclassIdentifier< B > *identifier)
Returns true if the object's class is a parent of the given type.
Definition: Identifiable.h:82
bool isDirectParentOf(const SubclassIdentifier< B > *identifier)
Returns true if the object's class is a direct parent of the given type.
Definition: Identifiable.h:85
bool isExactlyA(const SubclassIdentifier< B > *identifier)
Returns true if the object's class is exactly of the given type.
Definition: Identifiable.h:73
Die Wagnis Klasse hat die folgenden Aufgaben:
Definition: ApplicationPaths.cc:66
#define _CoreExport
Definition: CorePrereqs.h:61
The Identifier is used to identify the class of an object and to store information about the class...
Definition: Identifier.h:109
ORX_FORCEINLINE void * getDerivedPointer(unsigned int classID)
Returns a valid pointer of any derived type that is registered in the class hierarchy.
Definition: Identifiable.h:102
bool isA(const SubclassIdentifier< B > *identifier)
Returns true if the object's class is of the given type or a derivative.
Definition: Identifiable.h:70
Definition: InputPrereqs.h:78
#define ORX_FORCEINLINE
Definition: OrxonoxConfig.h:95
bool isDirectChildOf(const SubclassIdentifier< B > *identifier)
Returns true if the object's class is a direct child of the given type.
Definition: Identifiable.h:79
The SubclassIdentifier acts almost like an Identifier, but has some prerequisites.
Definition: SubclassIdentifier.h:90
virtual ~Identifiable()
Definition: Identifiable.h:57