- Timestamp:
- Dec 10, 2007, 5:07:46 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/core/Identifier.h
r452 r453 32 32 #include "Factory.h" 33 33 #include "ConfigValueContainer.h" 34 35 #define HIERARCHY_VERBOSE 0 36 34 #include "Debug.h" 37 35 38 36 namespace orxonox … … 118 116 { 119 117 hierarchyCreatingCounter_s++; 120 #if HIERARCHY_VERBOSE 121 std::cout << "*** Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n"; 122 #endif 118 COUT(4) << "*** Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n"; 123 119 } 124 120 … … 129 125 { 130 126 hierarchyCreatingCounter_s--; 131 #if HIERARCHY_VERBOSE 132 std::cout << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n"; 133 #endif 127 COUT(4) << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << "\n"; 134 128 } 135 129 … … 206 200 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass) 207 201 { 208 #if HIERARCHY_VERBOSE 209 std::cout << "*** Register Class in " << name << "-Singleton.\n"; 210 #endif 202 COUT(4) << "*** Register Class in " << name << "-Singleton.\n"; 211 203 212 204 // It's a singleton, so maybe we have to create it first 213 205 if (!pointer_s) 214 206 { 215 #if HIERARCHY_VERBOSE 216 std::cout << "*** Register Class in " << name << "-Singleton -> Create Singleton.\n"; 217 #endif 207 COUT(4) << "*** Register Class in " << name << "-Singleton -> Create Singleton.\n"; 218 208 pointer_s = new ClassIdentifier(); 219 209 } … … 224 214 // If no: We have to store the informations and initialize the Identifier 225 215 226 #if HIERARCHY_VERBOSE 227 std::cout << "*** Register Class in " << name << "-Singleton -> Initialize Singleton.\n"; 228 #endif 216 COUT(4) << "*** Register Class in " << name << "-Singleton -> Initialize Singleton.\n"; 229 217 pointer_s->name_ = name; 230 218 Factory::add(name, pointer_s); // Add the Identifier to the Factory … … 247 235 if (!pointer_s) 248 236 { 249 #if HIERARCHY_VERBOSE 250 std::cout << "*** Create Singleton.\n"; 251 #endif 237 COUT(4) << "*** Create Singleton.\n"; 252 238 pointer_s = new ClassIdentifier(); 253 239 } … … 263 249 void ClassIdentifier<T>::addObject(T* object) 264 250 { 265 #if HIERARCHY_VERBOSE 266 std::cout << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n"; 267 #endif 251 COUT(4) << "*** Added object to " << ClassIdentifier<T>::getIdentifier()->getName() << "-list.\n"; 268 252 object->getMetaList().add(ClassIdentifier<T>::getIdentifier()->objects_, ClassIdentifier<T>::getIdentifier()->objects_->add(object)); 269 253 } … … 300 284 if (!identifier->isA(ClassIdentifier<T>::getIdentifier())) 301 285 { 302 std::cout<< "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!\n";303 std::cout<< "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n";304 std::cout<< "Aborting...\n";286 COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!\n"; 287 COUT(1) << "Error: SubclassIdentifier<" << ClassIdentifier<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden.\n"; 288 COUT(1) << "Aborting...\n"; 305 289 abort(); 306 290 } … … 346 330 if (this->identifier_) 347 331 { 348 std::cout<< "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!\n";349 std::cout<< "Error: Couldn't fabricate a new Object.\n";350 std::cout<< "Aborting...\n";332 COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassIdentifier<T>::getIdentifier()->getName() << "!\n"; 333 COUT(1) << "Error: Couldn't fabricate a new Object.\n"; 334 COUT(1) << "Aborting...\n"; 351 335 } 352 336 else 353 337 { 354 std::cout<< "Error: Couldn't fabricate a new Object - Identifier is undefined.\n";355 std::cout<< "Aborting...\n";338 COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined.\n"; 339 COUT(1) << "Aborting...\n"; 356 340 } 357 341
Note: See TracChangeset
for help on using the changeset viewer.