Changeset 231 for code/branches/objecthierarchie/src/Identifier.h
- Timestamp:
- Nov 20, 2007, 10:42:34 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchie/src/Identifier.h
r224 r231 6 6 #include "IdentifierList.h" 7 7 #include "ObjectList.h" 8 //#include "OrxonoxClass.h"9 8 #include "Factory.h" 10 9 11 // DONE AND TESTED: 12 // - build class hierarchy 13 // - isA, isChildOf, ... 14 // - insert into class-lists 15 // - ClassIdentifier 16 // - BaseIdentifier 17 // - Factory 18 19 // IN WORK: 20 21 // TO DO: 22 // - iterate through lists 10 #define HIERARCHY_VERBOSE false 11 23 12 24 13 namespace orxonox … … 63 52 void initialize(IdentifierList* parents); 64 53 65 static void startCreatingHierarchy() { hierarchyCreatingCounter_s++; std::cout << "*** Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n"; } 66 static void stopCreatingHierarchy() { hierarchyCreatingCounter_s--; std::cout << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n"; } 54 static void startCreatingHierarchy() 55 { 56 hierarchyCreatingCounter_s++; 57 #if HIERARCHY_VERBOSE 58 std::cout << "*** Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n"; 59 #endif 60 } 61 62 static void stopCreatingHierarchy() 63 { 64 hierarchyCreatingCounter_s--; 65 #if HIERARCHY_VERBOSE 66 std::cout << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n"; 67 #endif 68 } 67 69 68 70 IdentifierList directParents_; … … 144 146 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(IdentifierList* parents, std::string name, bool bRootClass, bool bIsAbstractClass) 145 147 { 148 #if HIERARCHY_VERBOSE 146 149 std::cout << "*** Register Class in " << name << "-Singleton.\n"; 150 #endif 147 151 if (!pointer_s) 148 152 { 153 #if HIERARCHY_VERBOSE 149 154 std::cout << "*** Register Class in " << name << "-Singleton -> Create Singleton.\n"; 155 #endif 150 156 if (parents || bRootClass) 151 157 { … … 173 179 ClassIdentifier<T>* ClassIdentifier<T>::getIdentifier() 174 180 { 181 #if HIERARCHY_VERBOSE 175 182 // std::cout << "*** Get Identifier.\n"; 183 #endif 176 184 if (!pointer_s) 177 185 { 186 #if HIERARCHY_VERBOSE 178 187 std::cout << "*** Get Identifier -> Create Class\n"; 188 #endif 179 189 Identifier::startCreatingHierarchy(); 180 190 T* temp = new T(); … … 189 199 void ClassIdentifier<T>::addObject(T* object) 190 200 { 201 #if HIERARCHY_VERBOSE 191 202 std::cout << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n"; 203 #endif 192 204 ClassIdentifier<T>::getIdentifier()->objects_s.add(object); 193 205 } … … 198 210 bool bIterateForwards = !Identifier::isCreatingHierarchy(); 199 211 212 #if HIERARCHY_VERBOSE 200 213 if (bIterateForwards) 201 214 std::cout << "*** Removed object from " << this->name_ << "-list, iterating forwards.\n"; 202 215 else 203 216 std::cout << "*** Removed object from " << this->name_ << "-list, iterating backwards.\n"; 217 #endif 204 218 205 219 this->objects_s.remove(object, bIterateForwards);
Note: See TracChangeset
for help on using the changeset viewer.