Changeset 5879 for code/branches/core5/src/libraries/core/OrxonoxClass.h
- Timestamp:
- Oct 5, 2009, 5:02:25 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/core/OrxonoxClass.h
r5823 r5879 110 110 Returns NULL if the no pointer was found. 111 111 */ 112 template <class T> 113 FORCEINLINE T* getDerivedPointer(unsigned int classID) 112 FORCEINLINE void* getDerivedPointer(unsigned int classID) 114 113 { 115 114 for (int i = this->objectPointers_.size() - 1; i >= 0; --i) 116 115 { 117 116 if (this->objectPointers_[i].first == classID) 118 return static_cast<T*>(this->objectPointers_[i].second);117 return this->objectPointers_[i].second; 119 118 } 120 119 return NULL; 121 120 } 122 //! Const version of getDerivedPointer 123 template <class T> 124 FORCEINLINE const T* getDerivedPointer(unsigned int classID) const 125 { 126 return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID); 127 } 121 122 //! Version of getDerivedPointer with template 123 template <class T> FORCEINLINE T* getDerivedPointer(unsigned int classID) 124 { return static_cast<T*>(this->getDerivedPointer(classID)); } 125 //! Const version of getDerivedPointer with template 126 template <class T> FORCEINLINE const T* getDerivedPointer(unsigned int classID) const 127 { return const_cast<OrxonoxClass*>(this)->getDerivedPointer<T>(classID); } 128 128 129 129 private:
Note: See TracChangeset
for help on using the changeset viewer.