Changeset 9570 for code/branches/core6/src/libraries/core/object
- Timestamp:
- Mar 24, 2013, 8:51:37 PM (12 years ago)
- Location:
- code/branches/core6/src/libraries/core/object
- Files:
-
- 1 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/object/CMakeLists.txt
r9562 r9570 2 2 Context.cc 3 3 ContextObject.cc 4 Destroyable.cc 4 5 MetaObjectList.cc 5 6 ObjectListBase.cc -
code/branches/core6/src/libraries/core/object/Destroyable.cc
r9565 r9570 29 29 /** 30 30 @file 31 @brief Implementation of OrxonoxClass.31 @brief Implementation of Destroyable. 32 32 */ 33 33 34 #include " OrxonoxClass.h"34 #include "Destroyable.h" 35 35 36 36 #include <cassert> 37 #include "core/object/MetaObjectList.h"38 #include "core/object/Context.h"39 #include "Identifier.h"40 37 41 38 namespace orxonox … … 44 41 @brief Constructor: Sets the default values. 45 42 */ 46 OrxonoxClass::OrxonoxClass()43 Destroyable::Destroyable() 47 44 { 48 45 this->referenceCount_ = 0; … … 53 50 @brief Destructor: Notifies all DestructionListener (for example @ref WeakPtr "weak pointers") that this object is being deleted. 54 51 */ 55 OrxonoxClass::~OrxonoxClass()52 Destroyable::~Destroyable() 56 53 { 57 54 assert(this->referenceCount_ <= 0); … … 65 62 @brief Deletes the object if no @ref orxonox::SmartPtr "smart pointers" point to this object. Otherwise schedules the object to be deleted as soon as possible. 66 63 */ 67 void OrxonoxClass::destroy()64 void Destroyable::destroy() 68 65 { 69 66 assert(this); // Just in case someone tries to delete a NULL pointer -
code/branches/core6/src/libraries/core/object/Destroyable.h
r9565 r9570 28 28 29 29 /** 30 @defgroup OrxonoxClass OrxonoxClass 31 @ingroup Class 30 @file 31 @ingroup Object 32 @brief Declaration of Destroyable, the base class of all objects which can be used with SmartPtr and WeakPtr. 32 33 */ 33 34 34 /** 35 @file 36 @ingroup Class OrxonoxClass 37 @brief Declaration of OrxonoxClass, the base class of all objects and interfaces in Orxonox. 38 */ 39 40 #ifndef _OrxonoxClass_H__ 41 #define _OrxonoxClass_H__ 35 #ifndef _Destroyable_H__ 36 #define _Destroyable_H__ 42 37 43 38 #include "core/CorePrereqs.h" 44 39 45 40 #include <set> 46 //#include "Super.h"47 #include "Identifiable.h"48 41 49 42 namespace orxonox 50 43 { 51 44 /** 52 @brief The class all objects and interfaces of the game-logic (not the engine) are derived from. 53 54 The BaseObject and Interfaces are derived with @c virtual @c public @c OrxonoxClass from OrxonoxClass. 45 @brief Classes must inherit from this class if they should be used with SmartPtr or WeakPtr. 55 46 */ 56 class _CoreExport OrxonoxClass : public Identifiable47 class _CoreExport Destroyable 57 48 { 58 49 template <class T> … … 62 53 63 54 public: 64 OrxonoxClass();65 virtual ~ OrxonoxClass();55 Destroyable(); 56 virtual ~Destroyable(); 66 57 67 58 void destroy(); 68 69 /// Function to collect the SetConfigValue-macro calls.70 void setConfigValues() {};71 59 72 60 /// Returns the number of @ref orxonox::SmartPtr "smart pointers" that point to this object. … … 103 91 104 92 /** 105 @brief This listener is used to inform weak pointers if an object of type OrxonoxClassgets destroyed.93 @brief This listener is used to inform weak pointers if an object of type Destroyable gets destroyed. 106 94 */ 107 95 class _CoreExport DestructionListener 108 96 { 109 friend class OrxonoxClass;97 friend class Destroyable; 110 98 111 99 protected: 112 100 virtual ~DestructionListener() {} 113 101 114 inline void registerAsDestructionListener( OrxonoxClass* object)102 inline void registerAsDestructionListener(Destroyable* object) 115 103 { if (object) { object->registerDestructionListener(this); } } 116 inline void unregisterAsDestructionListener( OrxonoxClass* object)104 inline void unregisterAsDestructionListener(Destroyable* object) 117 105 { if (object) { object->unregisterDestructionListener(this); } } 118 106 … … 122 110 } 123 111 124 #endif /* _ OrxonoxClass_H__ */112 #endif /* _Destroyable_H__ */
Note: See TracChangeset
for help on using the changeset viewer.