Changeset 6038 for sandbox/src/libraries/core/OrxonoxClass.h
- Timestamp:
- Nov 5, 2009, 9:22:22 PM (14 years ago)
- Location:
- sandbox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
sandbox
- Property svn:mergeinfo changed
-
sandbox/src/libraries/core/OrxonoxClass.h
r5738 r6038 72 72 bool isDirectParentOf(const Identifier* identifier); 73 73 74 template <class B> bool isA(const SubclassIdentifier<B>* identifier); 75 template <class B> bool isExactlyA(const SubclassIdentifier<B>* identifier); 76 template <class B> bool isChildOf(const SubclassIdentifier<B>* identifier); 77 template <class B> bool isDirectChildOf(const SubclassIdentifier<B>* identifier); 78 template <class B> bool isParentOf(const SubclassIdentifier<B>* identifier); 79 template <class B> bool isDirectParentOf(const SubclassIdentifier<B>* identifier); 80 81 template <class B> bool isA(const SubclassIdentifier<B> identifier); 82 template <class B> bool isExactlyA(const SubclassIdentifier<B> identifier); 83 template <class B> bool isChildOf(const SubclassIdentifier<B> identifier); 84 template <class B> bool isDirectChildOf(const SubclassIdentifier<B> identifier); 85 template <class B> bool isParentOf(const SubclassIdentifier<B> identifier); 86 template <class B> bool isDirectParentOf(const SubclassIdentifier<B> identifier); 74 template <class B> inline bool isA(const SubclassIdentifier<B>* identifier) 75 { return this->isA(*identifier); } 76 template <class B> inline bool isExactlyA(const SubclassIdentifier<B>* identifier) 77 { return this->isExactlyA(*identifier); } 78 template <class B> inline bool isChildOf(const SubclassIdentifier<B>* identifier) 79 { return this->isChildOf(*identifier); } 80 template <class B> inline bool isDirectChildOf(const SubclassIdentifier<B>* identifier) 81 { return this->isDirectChildOf(*identifier); } 82 template <class B> inline bool isParentOf(const SubclassIdentifier<B>* identifier) 83 { return this->isParentOf(*identifier); } 84 template <class B> inline bool isDirectParentOf(const SubclassIdentifier<B>* identifier) 85 { return this->isDirectParentOf(*identifier); } 87 86 88 87 bool isA(const OrxonoxClass* object); … … 100 99 Returns NULL if the no pointer was found. 101 100 */ 102 template <class T> 103 FORCEINLINE T* getDerivedPointer(unsigned int classID) 101 FORCEINLINE void* getDerivedPointer(unsigned int classID) 104 102 { 105 103 for (int i = this->objectPointers_.size() - 1; i >= 0; --i) 106 104 { 107 105 if (this->objectPointers_[i].first == classID) 108 return static_cast<T*>(this->objectPointers_[i].second);106 return this->objectPointers_[i].second; 109 107 } 110 108 return NULL; 111 109 } 112 //! Const version of getDerivedPointer 113 template <class T> 114 FORCEINLINE const T* getDerivedPointer(unsigned int classID) const 115 { 116 return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID); 117 } 110 111 //! Version of getDerivedPointer with template 112 template <class T> FORCEINLINE T* getDerivedPointer(unsigned int classID) 113 { return static_cast<T*>(this->getDerivedPointer(classID)); } 114 //! Const version of getDerivedPointer with template 115 template <class T> FORCEINLINE const T* getDerivedPointer(unsigned int classID) const 116 { return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID); } 118 117 119 118 private:
Note: See TracChangeset
for help on using the changeset viewer.