- Timestamp:
- Mar 24, 2013, 6:34:23 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core6/src/libraries/core/class/OrxonoxClass.cc
r9563 r9565 46 46 OrxonoxClass::OrxonoxClass() 47 47 { 48 this->identifier_ = 0;49 this->parents_ = 0;50 this->metaList_ = new MetaObjectList();51 48 this->referenceCount_ = 0; 52 49 this->requestedDestruction_ = false; 53 // Optimisation54 this->objectPointers_.reserve(6);55 50 } 56 51 57 52 /** 58 @brief Destructor: Removes the object from the object-lists, notifies all DestructionListener (for example @ref WeakPtr "weak pointers") that this object is being deleted.53 @brief Destructor: Notifies all DestructionListener (for example @ref WeakPtr "weak pointers") that this object is being deleted. 59 54 */ 60 55 OrxonoxClass::~OrxonoxClass() 61 56 { 62 // if (!this->requestedDestruction_)63 // orxout(internal_warning) << "Destroyed object without destroy() (" << this->getIdentifier()->getName() << ')' << endl;64 65 57 assert(this->referenceCount_ <= 0); 66 67 this->unregisterObject();68 69 // parents_ exists only if isCreatingHierarchy() of the associated Identifier returned true while creating the class70 if (this->parents_)71 delete this->parents_;72 58 73 59 // notify all destruction listeners … … 90 76 } 91 77 } 92 93 /**94 @brief Removes this object from the object-lists.95 */96 void OrxonoxClass::unregisterObject()97 {98 if (this->metaList_)99 delete this->metaList_;100 this->metaList_ = 0;101 }102 103 /// Returns true if the object's class is of the given type or a derivative.104 bool OrxonoxClass::isA(const Identifier* identifier)105 { return this->getIdentifier()->isA(identifier); }106 /// Returns true if the object's class is exactly of the given type.107 bool OrxonoxClass::isExactlyA(const Identifier* identifier)108 { return this->getIdentifier()->isExactlyA(identifier); }109 /// Returns true if the object's class is a child of the given type.110 bool OrxonoxClass::isChildOf(const Identifier* identifier)111 { return this->getIdentifier()->isChildOf(identifier); }112 /// Returns true if the object's class is a direct child of the given type.113 bool OrxonoxClass::isDirectChildOf(const Identifier* identifier)114 { return this->getIdentifier()->isDirectChildOf(identifier); }115 /// Returns true if the object's class is a parent of the given type.116 bool OrxonoxClass::isParentOf(const Identifier* identifier)117 { return this->getIdentifier()->isParentOf(identifier); }118 /// Returns true if the object's class is a direct parent of the given type.119 bool OrxonoxClass::isDirectParentOf(const Identifier* identifier)120 { return this->getIdentifier()->isDirectParentOf(identifier); }121 122 123 /// Returns true if the object's class is of the given type or a derivative.124 bool OrxonoxClass::isA(const OrxonoxClass* object)125 { return this->getIdentifier()->isA(object->getIdentifier()); }126 /// Returns true if the object's class is exactly of the given type.127 bool OrxonoxClass::isExactlyA(const OrxonoxClass* object)128 { return this->getIdentifier()->isExactlyA(object->getIdentifier()); }129 /// Returns true if the object's class is a child of the given type.130 bool OrxonoxClass::isChildOf(const OrxonoxClass* object)131 { return this->getIdentifier()->isChildOf(object->getIdentifier()); }132 /// Returns true if the object's class is a direct child of the given type.133 bool OrxonoxClass::isDirectChildOf(const OrxonoxClass* object)134 { return this->getIdentifier()->isDirectChildOf(object->getIdentifier()); }135 /// Returns true if the object's class is a parent of the given type.136 bool OrxonoxClass::isParentOf(const OrxonoxClass* object)137 { return this->getIdentifier()->isParentOf(object->getIdentifier()); }138 /// Returns true if the object's class is a direct child of the given type.139 bool OrxonoxClass::isDirectParentOf(const OrxonoxClass* object)140 { return this->getIdentifier()->isDirectParentOf(object->getIdentifier()); }141 78 }
Note: See TracChangeset
for help on using the changeset viewer.