Changeset 1591 for code/branches/core3/src/core/Identifier.h
- Timestamp:
- Jun 12, 2008, 2:00:15 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/core/Identifier.h
r1586 r1591 60 60 #include <utility> 61 61 62 #include "Iterator.h" 62 #include "MetaObjectList.h" 63 #include "ObjectListBase.h" 63 64 #include "util/Debug.h" 64 65 #include "util/String.h" … … 103 104 bool isDirectParentOf(const Identifier* identifier) const; 104 105 105 void addObject(OrxonoxClass* object);106 107 106 /** @brief Returns the list of all existing objects of this class. @return The list */ 108 107 inline ObjectListBase* getObjects() const … … 113 112 void setName(const std::string& name); 114 113 115 v irtual void updateConfigValues() const = 0;114 void updateConfigValues() const; 116 115 117 116 /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */ … … 231 230 232 231 bool bCreatedOneObject_; //!< True if at least one object of the given type was created (used to determine the need of storing the parents) 232 ObjectListBase* objects_; //!< The list of all objects of this class 233 233 234 234 private: … … 264 264 bool bSetName_; //!< True if the name is set 265 265 std::string name_; //!< The name of the class the Identifier belongs to 266 ObjectListBase* objects_; //!< The list of all objects of this class267 266 BaseFactory* factory_; //!< The Factory, able to create new objects of the given class (if available) 268 267 static int hierarchyCreatingCounter_s; //!< Bigger than zero if at least one Identifier stores its parents (its an int instead of a bool to avoid conflicts with multithreading) … … 301 300 void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass); 302 301 static bool isFirstCall(); 303 304 void updateConfigValues() const; 302 void addObject(T* object); 305 303 306 304 XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname); … … 411 409 412 410 /** 413 @brief Updates the config-values of all existing objects of this class by calling their setConfigValues() function. 414 */ 415 template <class T> 416 void ClassIdentifier<T>::updateConfigValues() const 417 { 418 for (Iterator<T> it = this->getObjects()->begin(); it; ++it) 419 (*it)->setConfigValues(); 411 @brief Adds an object of the given type to the ObjectList. 412 @param object The object to add 413 */ 414 template <class T> 415 void ClassIdentifier<T>::addObject(T* object) 416 { 417 COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl; 418 object->getMetaList().add(this->objects_, this->objects_->add(new ObjectListElement<T>(object))); 420 419 } 421 420
Note: See TracChangeset
for help on using the changeset viewer.