Changeset 9572
- Timestamp:
- Mar 24, 2013, 10:30:39 PM (12 years ago)
- Location:
- code/branches/core6/src/libraries/core
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/CorePrereqs.h
r9570 r9572 161 161 class Iterator; 162 162 class Language; 163 class Listable; 163 164 class LuaFunctor; 164 165 class LuaState; -
code/branches/core6/src/libraries/core/class/Identifiable.cc
r9567 r9572 48 48 this->identifier_ = 0; 49 49 this->parents_ = 0; 50 this->metaList_ = new MetaObjectList();51 50 // Optimisation 52 51 this->objectPointers_.reserve(6); … … 58 57 Identifiable::~Identifiable() 59 58 { 60 // if (!this->requestedDestruction_)61 // orxout(internal_warning) << "Destroyed object without destroy() (" << this->getIdentifier()->getName() << ')' << endl;62 63 this->unregisterObject();64 65 59 // parents_ exists only if isCreatingHierarchy() of the associated Identifier returned true while creating the class 66 60 if (this->parents_) 67 61 delete this->parents_; 68 }69 70 /**71 @brief Removes this object from the object-lists.72 */73 void Identifiable::unregisterObject()74 {75 if (this->metaList_)76 delete this->metaList_;77 this->metaList_ = 0;78 62 } 79 63 -
code/branches/core6/src/libraries/core/class/Identifiable.h
r9570 r9572 56 56 Identifiable(); 57 57 virtual ~Identifiable(); 58 59 void unregisterObject();60 58 61 59 /// Returns the Identifier of the object. … … 120 118 121 119 private: 122 Identifier* identifier_; //!< The Identifier of the object 123 std::set<const Identifier*>* parents_; //!< List of all parents of the object 124 MetaObjectList* metaList_; //!< MetaObjectList, containing all ObjectLists and ObjectListElements the object is registered in 120 Identifier* identifier_; //!< The Identifier of the object 121 std::set<const Identifier*>* parents_; //!< List of all parents of the object 125 122 126 123 /// 'Fast map' that holds this-pointers of all derived types -
code/branches/core6/src/libraries/core/class/Identifier.h
r9566 r9572 288 288 289 289 bool initialiseObject(T* object, const std::string& className, bool bRootClass); 290 291 void addObjectToList(T* object, Listable*); 292 void addObjectToList(T* object, Identifiable*); 290 293 291 294 void updateConfigValues(bool updateChildren = true) const; … … 392 395 else 393 396 { 394 orxout(verbose, context::object_list) << "Added object to " << this->getName() << "-list." << endl; 395 object->metaList_->add(this->objects_, this->objects_->add(new ObjectListElement<T>(object))); 397 this->addObjectToList(object, object); 396 398 397 399 // Add pointer of type T to the map in the Identifiable instance that enables "dynamic_casts" … … 399 401 return false; 400 402 } 403 } 404 405 /** 406 * @brief Only adds the object to the object list if is a @ref Listable 407 */ 408 template <class T> 409 void ClassIdentifier<T>::addObjectToList(T* object, Listable*) 410 { 411 orxout(verbose, context::object_list) << "Added object to " << this->getName() << "-list." << endl; 412 object->metaList_->add(this->objects_, this->objects_->add(new ObjectListElement<T>(object))); 413 } 414 415 template <class T> 416 void ClassIdentifier<T>::addObjectToList(T*, Identifiable*) 417 { 418 // no action 401 419 } 402 420 -
code/branches/core6/src/libraries/core/class/OrxonoxClass.h
r9570 r9572 43 43 #include "core/CorePrereqs.h" 44 44 45 #include " Identifiable.h"45 #include "core/object/Listable.h" 46 46 #include "core/object/Destroyable.h" 47 47 … … 53 53 The BaseObject and Interfaces are derived with @c virtual @c public @c OrxonoxClass from OrxonoxClass. 54 54 */ 55 class _CoreExport OrxonoxClass : public Identifiable,public Destroyable55 class _CoreExport OrxonoxClass : virtual public Listable, virtual public Destroyable 56 56 { 57 57 public: -
code/branches/core6/src/libraries/core/object/CMakeLists.txt
r9570 r9572 3 3 ContextObject.cc 4 4 Destroyable.cc 5 Listable.cc 5 6 MetaObjectList.cc 6 7 ObjectListBase.cc
Note: See TracChangeset
for help on using the changeset viewer.