Changeset 242
- Timestamp:
- Nov 25, 2007, 3:34:55 AM (17 years ago)
- Location:
- code/branches/objecthierarchie/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchie/src/BaseObject.h
r239 r242 25 25 { this->getIdentifier()->isDirectParentOf(identifier); } 26 26 27 inline bool isA(const BaseIdentifier<class B>* identifier)27 inline bool isA(const SubclassIdentifier<class B>* identifier) 28 28 { this->getIdentifier()->isA(identifier->getIdentifier()); } 29 inline bool isDirectlyA(const BaseIdentifier<class B>* identifier)29 inline bool isDirectlyA(const SubclassIdentifier<class B>* identifier) 30 30 { this->getIdentifier()->isDirectlyA(identifier->getIdentifier()); } 31 inline bool isChildOf(const BaseIdentifier<class B>* identifier)31 inline bool isChildOf(const SubclassIdentifier<class B>* identifier) 32 32 { this->getIdentifier()->isChildOf(identifier->getIdentifier()); } 33 inline bool isDirectChildOf(const BaseIdentifier<class B>* identifier)33 inline bool isDirectChildOf(const SubclassIdentifier<class B>* identifier) 34 34 { this->getIdentifier()->isDirectChildOf(identifier->getIdentifier()); } 35 inline bool isParentOf(const BaseIdentifier<class B>* identifier)35 inline bool isParentOf(const SubclassIdentifier<class B>* identifier) 36 36 { this->getIdentifier()->isParentOf(identifier->getIdentifier()); } 37 inline bool isDirectParentOf(const BaseIdentifier<class B>* identifier)37 inline bool isDirectParentOf(const SubclassIdentifier<class B>* identifier) 38 38 { this->getIdentifier()->isDirectParentOf(identifier->getIdentifier()); } 39 39 40 inline bool isA(const BaseIdentifier<class B> identifier)40 inline bool isA(const SubclassIdentifier<class B> identifier) 41 41 { this->getIdentifier()->isA(identifier.getIdentifier()); } 42 inline bool isDirectlyA(const BaseIdentifier<class B> identifier)42 inline bool isDirectlyA(const SubclassIdentifier<class B> identifier) 43 43 { this->getIdentifier()->isDirectlyA(identifier.getIdentifier()); } 44 inline bool isChildOf(const BaseIdentifier<class B> identifier)44 inline bool isChildOf(const SubclassIdentifier<class B> identifier) 45 45 { this->getIdentifier()->isChildOf(identifier.getIdentifier()); } 46 inline bool isDirectChildOf(const BaseIdentifier<class B> identifier)46 inline bool isDirectChildOf(const SubclassIdentifier<class B> identifier) 47 47 { this->getIdentifier()->isDirectChildOf(identifier.getIdentifier()); } 48 inline bool isParentOf(const BaseIdentifier<class B> identifier)48 inline bool isParentOf(const SubclassIdentifier<class B> identifier) 49 49 { this->getIdentifier()->isParentOf(identifier.getIdentifier()); } 50 inline bool isDirectParentOf(const BaseIdentifier<class B> identifier)50 inline bool isDirectParentOf(const SubclassIdentifier<class B> identifier) 51 51 { this->getIdentifier()->isDirectParentOf(identifier.getIdentifier()); } 52 52 -
code/branches/objecthierarchie/src/Identifier.h
r241 r242 24 24 25 25 template <class T> 26 friend class BaseIdentifier;26 friend class SubclassIdentifier; 27 27 28 28 public: … … 231 231 232 232 // ############################### 233 // ### BaseIdentifier###233 // ### SubclassIdentifier ### 234 234 // ############################### 235 235 template <class B> 236 class BaseIdentifier236 class SubclassIdentifier 237 237 { 238 238 public: 239 BaseIdentifier();240 241 BaseIdentifier<B>& operator=(Identifier* identifier)239 SubclassIdentifier(); 240 241 SubclassIdentifier<B>& operator=(Identifier* identifier) 242 242 { 243 243 if (!identifier->isA(ClassIdentifier<B>::getIdentifier())) 244 244 { 245 245 std::cout << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<B>::getIdentifier()->getName() << "!\n"; 246 std::cout << "Error: BaseIdentifier<" << ClassIdentifier<B>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n";246 std::cout << "Error: SubclassIdentifier<" << ClassIdentifier<B>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n"; 247 247 std::cout << "Aborting...\n"; 248 248 abort(); … … 307 307 308 308 template <class B> 309 BaseIdentifier<B>::BaseIdentifier()309 SubclassIdentifier<B>::SubclassIdentifier() 310 310 { 311 311 this->identifier_ = ClassIdentifier<B>::getIdentifier(); -
code/branches/objecthierarchie/src/orxonox.cc
r225 r242 441 441 std::cout << "Test 7\n"; 442 442 std::cout << "1\n"; 443 BaseIdentifier<A1B1> test7_01;443 SubclassIdentifier<A1B1> test7_01; 444 444 test7_01 = Class(A1B1C1); 445 445 446 BaseIdentifier<A1B1> test7_02;446 SubclassIdentifier<A1B1> test7_02; 447 447 test7_02 = Class(A1B1); 448 448 … … 453 453 std::cout << "2\n"; 454 454 455 BaseIdentifier<A1B1> test7_03;455 SubclassIdentifier<A1B1> test7_03; 456 456 test7_03 = Class(A1); 457 457 458 BaseIdentifier<A1B1> test7_04;458 SubclassIdentifier<A1B1> test7_04; 459 459 test7_04 = Class(A1B2); 460 460 461 BaseIdentifier<A1B1> test7_05;461 SubclassIdentifier<A1B1> test7_05; 462 462 test7_05 = Class(A2); 463 463 */ … … 512 512 513 513 std::cout << "\n3\n"; 514 BaseIdentifier<A1> test9_04;514 SubclassIdentifier<A1> test9_04; 515 515 test9_04 = Class(A1B1C1); 516 516 A1* test9_05 = test9_04.fabricate(); -
code/branches/objecthierarchie/src/test1.h
r197 r242 23 23 Identifier* usefullClass1_; 24 24 Identifier* usefullClass2_; 25 BaseIdentifier<Test3> usefullClass3_;25 SubclassIdentifier<Test3> usefullClass3_; 26 26 27 27 }; -
code/branches/objecthierarchie/src/test2.h
r197 r242 24 24 Identifier* usefullClass1_; 25 25 Identifier* usefullClass2_; 26 BaseIdentifier<Test3> usefullClass3_;26 SubclassIdentifier<Test3> usefullClass3_; 27 27 28 28 };
Note: See TracChangeset
for help on using the changeset viewer.