Changeset 9571 for code/branches/core6/src/libraries/core/object/SmartPtr.h
- Timestamp:
- Mar 24, 2013, 9:03:22 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/object/SmartPtr.h
r9563 r9571 44 44 object and keeps this object alive until no SmartPtr points to this object anymore. 45 45 In contrast to orxonox::SharedPtr, SmartPtr works only with classes that are derived 46 from orxonox:: OrxonoxClass, because it's an intrusive implementation, meaning the46 from orxonox::Destroyable, because it's an intrusive implementation, meaning the 47 47 reference counter is stored in the object itself. 48 48 … … 78 78 }; 79 79 @endcode 80 In this example we assume that OtherClass is a child of OrxonoxClass. We don't care80 In this example we assume that OtherClass is a child of Destroyable. We don't care 81 81 about the inheritance of MyClass though. 82 82 … … 123 123 #include <cassert> 124 124 125 #include "core/ class/OrxonoxClass.h"125 #include "core/object/Destroyable.h" 126 126 #include "WeakPtr.h" 127 127 … … 227 227 } 228 228 229 /// Returns the wrapped pointer as @c OrxonoxClass*230 inline OrxonoxClass* getBase() const229 /// Returns the wrapped pointer as @c Destroyable* 230 inline Destroyable* getBase() const 231 231 { 232 232 return this->base_; … … 268 268 } 269 269 { 270 OrxonoxClass* temp = this->base_;270 Destroyable* temp = this->base_; 271 271 this->base_ = other.base_; 272 272 other.base_ = temp; … … 282 282 private: 283 283 T* pointer_; ///< The wrapped pointer to an object of type @a T 284 OrxonoxClass* base_; ///< The wrapped pointer, casted up to OrxonoxClass(this is needed because with just a T* pointer, SmartPtr couln't be used with forward declarations)284 Destroyable* base_; ///< The wrapped pointer, casted up to Destroyable (this is needed because with just a T* pointer, SmartPtr couln't be used with forward declarations) 285 285 }; 286 286
Note: See TracChangeset
for help on using the changeset viewer.