Changeset 150 for code/branches/objecthierarchie/src
- Timestamp:
- Nov 2, 2007, 2:28:23 AM (17 years ago)
- Location:
- code/branches/objecthierarchie/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchie/src/BaseObject.h
r149 r150 25 25 { this->identifier_->isDirectParentOf(identifier); } 26 26 27 Identifier* identifier_;27 ClassIdentifier<class BaseObject>* identifier_; 28 28 29 29 protected: -
code/branches/objecthierarchie/src/ClassHierarchy.cc
r149 r150 6 6 // ### Identifier ### 7 7 // ############################### 8 Identifier* Identifier::pointer_ = NULL;8 // Identifier* Identifier::pointer_ = NULL; 9 9 /* 10 10 Identifier* Identifier::registerClass(IdentifierList* parents) … … 65 65 { 66 66 this->directParents_->add(temp1->identifier_); 67 temp1->identifier_->directChildren_->add(this ->pointer_);67 temp1->identifier_->directChildren_->add(this); 68 68 } 69 69 70 70 this->allParents_->add(temp1->identifier_); 71 temp1->identifier_->allChildren_->add(this ->pointer_);71 temp1->identifier_->allChildren_->add(this); 72 72 73 73 temp1 = temp1->next_; … … 88 88 bool Identifier::isA(Identifier* identifier) 89 89 { 90 return (identifier == this ->pointer_|| this->allParents_->isInList(identifier));90 return (identifier == this || this->allParents_->isInList(identifier)); 91 91 } 92 92 93 93 bool Identifier::isDirectA(Identifier* identifier) 94 94 { 95 return (identifier == this ->pointer_);95 return (identifier == this); 96 96 } 97 97 -
code/branches/objecthierarchie/src/ClassHierarchy.h
r149 r150 22 22 class ObjectList; 23 23 class BaseObject; 24 template <class T> 25 class ClassIdentifier; 24 26 25 27 class Identifier … … 29 31 30 32 public: 31 // static Identifier* registerClass(IdentifierList* parents);32 33 void addObject(BaseObject* object); 33 34 void removeObject(BaseObject* object); … … 40 41 bool isDirectParentOf(Identifier* identifier); 41 42 42 pr otected:43 private: 43 44 Identifier(); 44 void initialize(IdentifierList* identifier); 45 46 static Identifier* pointer_; 45 void initialize(IdentifierList* parents); 47 46 48 47 IdentifierList* directParents_; … … 54 53 std::string name_; 55 54 56 private:57 55 bool bCreatedOneObject_; 58 56 }; … … 61 59 class ClassIdentifier : public Identifier 62 60 { 63 // friend class Identifier;64 65 61 public: 66 static Identifier* registerClass(IdentifierList* parents);67 static Identifier* getIdentifier();62 static ClassIdentifier<T>* registerClass(IdentifierList* parents); 63 static ClassIdentifier<T>* getIdentifier(); 68 64 static T* create(); 69 65 70 66 private: 71 67 ClassIdentifier(); 68 69 static ClassIdentifier<T>* pointer_; 70 72 71 }; 73 72 74 73 #define getStringFromClassName(ClassName) \ 75 74 #ClassName 75 76 template <class T> 77 ClassIdentifier<T>* ClassIdentifier<T>::pointer_ = NULL; 76 78 77 79 template <class T> … … 81 83 82 84 template <class T> 83 Identifier* ClassIdentifier<T>::registerClass(IdentifierList* parents)85 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(IdentifierList* parents) 84 86 { 85 87 if (!pointer_) … … 94 96 95 97 template <class T> 96 Identifier* ClassIdentifier<T>::getIdentifier()98 ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier() 97 99 { 98 100 if (!pointer_)
Note: See TracChangeset
for help on using the changeset viewer.