Changeset 1574 for code/branches/core3/src/core/Identifier.h
- Timestamp:
- Jun 9, 2008, 4:35:38 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core3/src/core/Identifier.h
r1543 r1574 60 60 #include <utility> 61 61 62 #include "ObjectList.h"63 62 #include "Debug.h" 64 63 #include "Iterator.h" 65 #include "MetaObjectList.h"66 64 #include "util/String.h" 67 65 … … 108 106 bool isDirectParentOf(const Identifier* identifier) const; 109 107 110 virtual const ObjectList<BaseObject>* getObjectList() const = 0; 111 112 virtual void updateConfigValues() const = 0; 108 void addObject(OrxonoxClass* object); 109 110 /** @brief Returns the list of all existing objects of this class. @return The list */ 111 inline ObjectListBase* getObjects() const 112 { return this->objects_; } 113 113 114 114 /** @brief Returns the name of the class the Identifier belongs to. @return The name */ 115 115 inline const std::string& getName() const { return this->name_; } 116 116 117 virtual void updateConfigValues() const = 0; 117 118 118 119 /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */ … … 263 264 std::string name_; //!< The name of the class the Identifier belongs to 264 265 266 ObjectListBase* objects_; //!< The list of all objects of this class 265 267 BaseFactory* factory_; //!< The Factory, able to create new objects of the given class (if available) 266 268 bool bCreatedOneObject_; //!< True if at least one object of the given type was created (used to determine the need of storing the parents) … … 297 299 public: 298 300 ClassIdentifier<T>* registerClass(std::set<const Identifier*>* parents, const std::string& name, bool bRootClass); 299 void addObject(T* object);300 301 void setName(const std::string& name); 301 /** @brief Returns the list of all existing objects of this class. @return The list */302 inline ObjectList<T>* getObjects() const { return this->objects_; }303 /** @brief Returns a list of all existing objects of this class. @return The list */304 inline ObjectList<BaseObject>* getObjectList() const { return (ObjectList<BaseObject>*)this->objects_; }305 302 306 303 void updateConfigValues() const; … … 319 316 ~ClassIdentifier() {} // don't delete 320 317 321 ObjectList<T>* objects_; //!< The ObjectList, containing all objects of type T322 318 bool bSetName_; //!< True if the name is set 323 319 std::map<std::string, XMLPortClassParamContainer<T>*> xmlportParamContainers_; //!< All loadable parameters … … 336 332 ClassIdentifier<T>::ClassIdentifier() 337 333 { 338 // this->objects_ = ObjectList<T>::getList();339 this->objects_ = new ObjectList<T>();340 334 this->bSetName_ = false; 341 335 } … … 408 402 409 403 /** 410 @brief Adds an object of the given type to the ObjectList.411 @param object The object to add412 */413 template <class T>414 void ClassIdentifier<T>::addObject(T* object)415 {416 COUT(5) << "*** ClassIdentifier: Added object to " << this->getName() << "-list." << std::endl;417 object->getMetaList().add(this->objects_, this->objects_->add(object));418 }419 420 /**421 404 @brief Updates the config-values of all existing objects of this class by calling their setConfigValues() function. 422 405 */ … … 424 407 void ClassIdentifier<T>::updateConfigValues() const 425 408 { 426 for (Iterator<T> it = this->objects_-> start(); it; ++it)427 ( (T*)*it)->setConfigValues();409 for (Iterator<T> it = this->objects_->begin(); it; ++it) 410 (*it)->setConfigValues(); 428 411 } 429 412
Note: See TracChangeset
for help on using the changeset viewer.