Changeset 811 for code/branches/core/src/orxonox/core/Identifier.h
- Timestamp:
- Feb 13, 2008, 6:39:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core/src/orxonox/core/Identifier.h
r810 r811 147 147 { 148 148 hierarchyCreatingCounter_s++; 149 COUT(4) << "*** I ncreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << std::endl;149 COUT(4) << "*** Identifier: Increased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << std::endl; 150 150 } 151 151 … … 156 156 { 157 157 hierarchyCreatingCounter_s--; 158 COUT(4) << "*** Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << std::endl;158 COUT(4) << "*** Identifier: Decreased Hierarchy-Creating-Counter to " << hierarchyCreatingCounter_s << std::endl; 159 159 } 160 160 … … 228 228 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(const IdentifierList* parents, const std::string& name, bool bRootClass) 229 229 { 230 COUT(4) << "*** Register Class in " << name << "-Singleton." << std::endl;230 COUT(4) << "*** ClassIdentifier: Register Class in " << name << "-Singleton." << std::endl; 231 231 232 232 // Check if at least one object of the given type was created … … 236 236 this->setName(name); 237 237 238 COUT(4) << "*** Register Class in " << name << "-Singleton -> Initialize Singleton." << std::endl;238 COUT(4) << "*** ClassIdentifier: Register Class in " << name << "-Singleton -> Initialize Singleton." << std::endl; 239 239 if (bRootClass) 240 240 this->initialize(NULL); // If a class is derived from two interfaces, the second interface might think it's derived from the first because of the order of constructor-calls. Thats why we set parents to zero in that case. … … 267 267 void ClassIdentifier<T>::addObject(T* object) 268 268 { 269 COUT(4) << "*** Added object to " << this->getName() << "-list." << std::endl;269 COUT(4) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl; 270 270 object->getMetaList().add(this->objects_, this->objects_->add(object)); 271 271 } … … 299 299 SubclassIdentifier() 300 300 { 301 std::string name = ClassManager<T>::getName(); 302 303 if (name != "unknown") 304 this->subclassIdentifier_ = ClassManager<T>::getIdentifier(name); 305 else 306 this->subclassIdentifier_ = 0; 307 308 this->identifier_ = this->subclassIdentifier_; 301 this->identifier_ = ClassManager<T>::getIdentifier(); 309 302 } 310 303 … … 315 308 SubclassIdentifier(Identifier* identifier) 316 309 { 317 std::string name = ClassManager<T>::getName();318 319 if (name != "unknown")320 this->subclassIdentifier_ = ClassManager<T>::getIdentifier(name);321 else322 this->subclassIdentifier_ = 0;323 324 310 this->identifier_ = identifier; 325 311 } … … 332 318 SubclassIdentifier<T>& operator=(Identifier* identifier) 333 319 { 334 if (!identifier->isA( this->subclassIdentifier_))320 if (!identifier->isA(ClassManager<T>::getIdentifier())) 335 321 { 336 COUT(1) << "Error: Class " << identifier->getName() << " is not a " << this->subclassIdentifier_->getName() << "!" << std::endl; 337 COUT(1) << "Error: SubclassIdentifier<" << this->subclassIdentifier_->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl; 322 COUT(1) << "An error occurred in SubclassIdentifier:" << std::endl; 323 COUT(1) << "Error: Class " << identifier->getName() << " is not a " << ClassManager<T>::getIdentifier()->getName() << "!" << std::endl; 324 COUT(1) << "Error: SubclassIdentifier<" << ClassManager<T>::getIdentifier()->getName() << "> = Class(" << identifier->getName() << ") is forbidden." << std::endl; 338 325 COUT(1) << "Aborting..." << std::endl; 339 326 abort(); … … 380 367 if (this->identifier_) 381 368 { 382 COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << this->subclassIdentifier_->getName() << "!" << std::endl; 369 COUT(1) << "An error occurred in SubclassIdentifier:" << std::endl; 370 COUT(1) << "Error: Class " << this->identifier_->getName() << " is not a " << ClassManager<T>::getIdentifier()->getName() << "!" << std::endl; 383 371 COUT(1) << "Error: Couldn't fabricate a new Object." << std::endl; 384 372 COUT(1) << "Aborting..." << std::endl; … … 386 374 else 387 375 { 376 COUT(1) << "An error occurred in SubclassIdentifier:" << std::endl; 388 377 COUT(1) << "Error: Couldn't fabricate a new Object - Identifier is undefined." << std::endl; 389 378 COUT(1) << "Aborting..." << std::endl; … … 416 405 private: 417 406 Identifier* identifier_; //!< The assigned identifier 418 Identifier* subclassIdentifier_; //!< The identifier of the subclass419 407 }; 420 408 }
Note: See TracChangeset
for help on using the changeset viewer.