- Timestamp:
- Aug 29, 2015, 5:35:59 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/libraries/core/object/Destroyable.h
r10419 r10555 30 30 @file 31 31 @ingroup Object 32 @brief Declaration of Destroyable, the base class of all objects which can be used with S martPtr and WeakPtr.32 @brief Declaration of Destroyable, the base class of all objects which can be used with StrongPtr and WeakPtr. 33 33 */ 34 34 … … 43 43 { 44 44 /** 45 @brief Classes must inherit from this class if they should be used with S martPtr or WeakPtr.45 @brief Classes must inherit from this class if they should be used with StrongPtr or WeakPtr. 46 46 */ 47 47 class _CoreExport Destroyable 48 48 { 49 49 template <class T> 50 friend class S martPtr;50 friend class StrongPtr; 51 51 52 52 friend class DestructionListener; … … 59 59 void destroyLater(); 60 60 61 /// Returns the number of @ref orxonox::S martPtr "smartpointers" that point to this object.61 /// Returns the number of @ref orxonox::StrongPtr "strong pointers" that point to this object. 62 62 inline unsigned int getReferenceCount() const 63 63 { return this->referenceCount_; } 64 64 65 65 protected: 66 /// This virtual function is called if destroy() is called and no S martPtr points to this object. Used in some cases to create a new SmartPtr to66 /// This virtual function is called if destroy() is called and no StrongPtr points to this object. Used in some cases to create a new StrongPtr to 67 67 /// prevent destruction. Don't call this function directly - use destroy() instead. 68 68 virtual void preDestroy() {} 69 69 70 70 private: 71 /// Increments the reference counter (for s martpointers).71 /// Increments the reference counter (for strong pointers). 72 72 inline void incrementReferenceCount() 73 73 { ++this->referenceCount_; } 74 /// Decrements the reference counter (for s martpointers).74 /// Decrements the reference counter (for strong pointers). 75 75 inline void decrementReferenceCount() 76 76 { … … 87 87 { this->destructionListeners_.erase(pointer); } 88 88 89 int referenceCount_; //!< Counts the references from s martpointers to this object89 int referenceCount_; //!< Counts the references from strong pointers to this object 90 90 bool requestedDestruction_; //!< Becomes true after someone called delete on this object 91 91 std::set<DestructionListener*> destructionListeners_; //!< All destruction listeners (for example weak pointers which point to this object and like to get notified if it dies)
Note: See TracChangeset
for help on using the changeset viewer.