Changeset 3224 for code/branches/core4/src/core/Identifier.h
- Timestamp:
- Jun 23, 2009, 8:14:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core4/src/core/Identifier.h
r3223 r3224 349 349 static ClassIdentifier<T> *getIdentifier(); 350 350 static ClassIdentifier<T> *getIdentifier(const std::string& name); 351 void addObject(T* object); 351 352 bool initialiseObject(T* object, const std::string& className, bool bRootClass); 352 353 353 354 void updateConfigValues(bool updateChildren = true) const; … … 428 429 */ 429 430 template <class T> 430 inline void ClassIdentifier<T>::addObject(T* object) 431 { 432 COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl; 433 object->getMetaList().add(this->objects_, this->objects_->add(new ObjectListElement<T>(object))); 434 // Add pointer of type T to the map in the OrxonoxClass instance that enables "dynamic_casts" 435 object->objectPointers_.push_back(std::make_pair(this->getClassID(), reinterpret_cast<void*>(object))); 431 bool ClassIdentifier<T>::initialiseObject(T* object, const std::string& className, bool bRootClass) 432 { 433 if (bRootClass) 434 COUT(5) << "*** Register Root-Object: " << className << std::endl; 435 else 436 COUT(5) << "*** Register Object: " << className << std::endl; 437 438 object->identifier_ = this; 439 if (Identifier::isCreatingHierarchy()) 440 { 441 if (bRootClass && !object->parents_) 442 object->parents_ = new std::set<const Identifier*>(); 443 444 if (object->parents_) 445 { 446 this->initializeClassHierarchy(object->parents_, bRootClass); 447 object->parents_->insert(object->parents_->end(), this); 448 } 449 450 object->setConfigValues(); 451 return true; 452 } 453 else 454 { 455 COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl; 456 object->metaList_->add(this->objects_, this->objects_->add(new ObjectListElement<T>(object))); 457 458 // Add pointer of type T to the map in the OrxonoxClass instance that enables "dynamic_casts" 459 object->objectPointers_.push_back(std::make_pair(this->getClassID(), reinterpret_cast<void*>(object))); 460 return false; 461 } 436 462 } 437 463
Note: See TracChangeset
for help on using the changeset viewer.