Changeset 231
- Timestamp:
- Nov 20, 2007, 10:42:34 PM (17 years ago)
- Location:
- code/branches/objecthierarchie/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchie/src/Identifier.cc
r224 r231 20 20 void Identifier::initialize(IdentifierList* parents) 21 21 { 22 #if HIERARCHY_VERBOSE 22 23 std::cout << "*** Initialize " << this->name_ << "-Singleton.\n"; 24 #endif 23 25 if (parents) 24 26 { -
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); -
code/branches/objecthierarchie/src/IdentifierIncludes.h
r224 r231 15 15 ClassIdentifier<ClassName>::addObject(this) 16 16 17 #if HIERARCHY_VERBOSE 17 18 #define registerRootObject(ClassName) \ 18 19 std::cout << "*** Register Root-Object: " << #ClassName << "\n"; \ 19 20 internRegisterRootObject(ClassName, false) 21 #else 22 #define registerRootObject(ClassName) \ 23 internRegisterRootObject(ClassName, false) 24 #endif 20 25 26 #if HIERARCHY_VERBOSE 21 27 #define registerAbstractRootObject(ClassName) \ 22 28 std::cout << "*** Register abstract Root-Object: " << #ClassName << "\n"; \ 23 29 internRegisterRootObject(ClassName, true) 30 #else 31 #define registerAbstractRootObject(ClassName) \ 32 internRegisterRootObject(ClassName, true) 33 #endif 24 34 25 35 #define internRegisterObject(ClassName, bAbstract) \ … … 29 39 ClassIdentifier<ClassName>::addObject(this) 30 40 41 #if HIERARCHY_VERBOSE 31 42 #define registerObject(ClassName) \ 32 43 std::cout << "*** Register Object: " << #ClassName << "\n"; \ 33 44 internRegisterObject(ClassName, false) 45 #else 46 #define registerObject(ClassName) \ 47 internRegisterObject(ClassName, false) 48 #endif 34 49 50 #if HIERARCHY_VERBOSE 35 51 #define registerAbstractObject(ClassName) \ 36 52 std::cout << "*** Register abstract Object: " << #ClassName << "\n"; \ 37 53 internRegisterObject(ClassName, true) 54 #else 55 #define registerAbstractObject(ClassName) \ 56 internRegisterObject(ClassName, true) 57 #endif 38 58 39 59 #define unregisterObject() \
Note: See TracChangeset
for help on using the changeset viewer.