Changeset 220
- Timestamp:
- Nov 19, 2007, 11:01:25 PM (17 years ago)
- Location:
- code/branches/objecthierarchie/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchie/src/BaseObject.h
r219 r220 50 50 inline bool isDirectParentOf(BaseIdentifier<class B> identifier) 51 51 { this->getIdentifier()->isDirectParentOf(identifier.getIdentifier()); } 52 /* 52 53 53 inline bool isA(OrxonoxClass* object) 54 54 { this->getIdentifier()->isA(object->getIdentifier()); } 55 55 inline bool isDirectlyA(OrxonoxClass* object) 56 { this->getIdentifier()->isDirectlyA(object->getIdentifier ); }56 { this->getIdentifier()->isDirectlyA(object->getIdentifier()); } 57 57 inline bool isChildOf(OrxonoxClass* object) 58 { this->getIdentifier()->isChildOf(object->getIdentifier ); }58 { this->getIdentifier()->isChildOf(object->getIdentifier()); } 59 59 inline bool isDirectChildOf(OrxonoxClass* object) 60 { this->getIdentifier()->isDirectChildOf(object->getIdentifier ); }60 { this->getIdentifier()->isDirectChildOf(object->getIdentifier()); } 61 61 inline bool isParentOf(OrxonoxClass* object) 62 { this->getIdentifier()->isParentOf(object->getIdentifier ); }62 { this->getIdentifier()->isParentOf(object->getIdentifier()); } 63 63 inline bool isDirectParentOf(OrxonoxClass* object) 64 { this->getIdentifier()->isDirectParentOf(object->getIdentifier ); }65 */ 64 { this->getIdentifier()->isDirectParentOf(object->getIdentifier()); } 65 66 66 }; 67 67 } -
code/branches/objecthierarchie/src/Identifier.cc
r219 r220 78 78 void Identifier::addObject(OrxonoxClass* object) 79 79 { 80 std::cout << "*** Added " << this->name_ << " tolist.\n";80 std::cout << "*** Added object to " << this->name_ << "-list.\n"; 81 81 this->objects_.add(object); 82 82 } … … 84 84 void Identifier::removeObject(OrxonoxClass* object) 85 85 { 86 std::cout << "*** Removed " << this->name_ << " fromlist.\n";86 std::cout << "*** Removed object from " << this->name_ << "-list.\n"; 87 87 this->objects_.remove(object); 88 89 IdentifierListElement* temp = this->directParents_.first_; 90 while (temp) 91 { 92 temp->identifier_->removeObject(object); 93 temp = temp->next_; 94 } 88 95 } 89 96 -
code/branches/objecthierarchie/src/Identifier.h
r219 r220 149 149 ClassFactory::add(name, pointer_s); 150 150 151 pointer_s->initialize(parents); 151 if (!bRootClass) 152 pointer_s->initialize(parents); 153 else 154 pointer_s->initialize(NULL); 152 155 } 153 156 else -
code/branches/objecthierarchie/src/IdentifierIncludes.h
r219 r220 6 6 7 7 8 #define registerRootObject(ClassName) \ 9 std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \ 8 #define internRegisterRootObject(ClassName, bAbstract) \ 10 9 if (Identifier::isCreatingHierarchy() && !this->getParents()) \ 11 10 this->setParents(new IdentifierList()); \ 12 if (this->getIdentifier()) \ 13 this->getIdentifier()->removeObject(this); \ 14 this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, false)); \ 11 this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, bAbstract)); \ 15 12 if (Identifier::isCreatingHierarchy() && this->getParents()) \ 16 13 this->getParents()->add(this->getIdentifier()); \ 17 14 this->getIdentifier()->addObject(this) 18 15 16 #define registerRootObject(ClassName) \ 17 std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \ 18 internRegisterRootObject(ClassName, false) 19 19 20 #define registerAbstractRootObject(ClassName) \ 20 std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \ 21 if (Identifier::isCreatingHierarchy() && !this->getParents()) \ 22 this->setParents(new IdentifierList()); \ 23 if (this->getIdentifier()) \ 24 this->getIdentifier()->removeObject(this); \ 25 this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, true, true)); \ 21 std::cout << "*** Register abstract Root-Object: " << #ClassName << "\n"; \ 22 internRegisterRootObject(ClassName, true) 23 24 #define internRegisterObject(ClassName, bAbstract) \ 25 this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, bAbstract)); \ 26 26 if (Identifier::isCreatingHierarchy() && this->getParents()) \ 27 27 this->getParents()->add(this->getIdentifier()); \ … … 30 30 #define registerObject(ClassName) \ 31 31 std::cout << "*** Register Object: " << #ClassName << "\n"; \ 32 this->getIdentifier()->removeObject(this); \ 33 this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, false)); \ 34 if (Identifier::isCreatingHierarchy() && this->getParents()) \ 35 this->getParents()->add(this->getIdentifier()); \ 36 this->getIdentifier()->addObject(this) 32 internRegisterObject(ClassName, false) 37 33 38 34 #define registerAbstractObject(ClassName) \ 39 std::cout << "*** Register Object: " << #ClassName << "\n"; \ 40 this->getIdentifier()->removeObject(this); \ 41 this->setIdentifier(ClassIdentifier<ClassName>::registerClass(this->getParents(), #ClassName, false, true)); \ 42 if (Identifier::isCreatingHierarchy() && this->getParents()) \ 43 this->getParents()->add(this->getIdentifier()); \ 44 this->getIdentifier()->addObject(this) 35 std::cout << "*** Register abstract Object: " << #ClassName << "\n"; \ 36 internRegisterObject(ClassName, true) 45 37 46 38 #define unregisterObject() \
Note: See TracChangeset
for help on using the changeset viewer.