Changeset 876 for code/branches/core2/src/orxonox/core/Identifier.h
- Timestamp:
- Mar 10, 2008, 12:27:30 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core2/src/orxonox/core/Identifier.h
r871 r876 52 52 #define _Identifier_H__ 53 53 54 #include < list>54 #include <set> 55 55 #include <map> 56 56 #include <string> … … 115 115 116 116 /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */ 117 inline const std:: list<const Identifier*>& getParents() const { return this->parents_; }117 inline const std::set<const Identifier*>& getParents() const { return this->parents_; } 118 118 /** @brief Returns the begin-iterator of the parents-list. @return The begin-iterator */ 119 inline std:: list<const Identifier*>::const_iterator getParentsBegin() const { return this->parents_.begin(); }119 inline std::set<const Identifier*>::const_iterator getParentsBegin() const { return this->parents_.begin(); } 120 120 /** @brief Returns the end-iterator of the parents-list. @return The end-iterator */ 121 inline std:: list<const Identifier*>::const_iterator getParentsEnd() const { return this->parents_.end(); }121 inline std::set<const Identifier*>::const_iterator getParentsEnd() const { return this->parents_.end(); } 122 122 123 123 /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */ 124 inline const std:: list<const Identifier*>& getChildren() const { return (*this->children_); }124 inline const std::set<const Identifier*>& getChildren() const { return (*this->children_); } 125 125 /** @brief Returns the begin-iterator of the children-list. @return The begin-iterator */ 126 inline std:: list<const Identifier*>::const_iterator getChildrenBegin() const { return this->children_->begin(); }126 inline std::set<const Identifier*>::const_iterator getChildrenBegin() const { return this->children_->begin(); } 127 127 /** @brief Returns the end-iterator of the children-list. @return The end-iterator */ 128 inline std:: list<const Identifier*>::const_iterator getChildrenEnd() const { return this->children_->end(); }128 inline std::set<const Identifier*>::const_iterator getChildrenEnd() const { return this->children_->end(); } 129 129 130 130 /** @brief Returns the direct parents of the class the Identifier belongs to. @return The list of all direct parents */ 131 inline const std:: list<const Identifier*>& getDirectParents() const { return this->directParents_; }131 inline const std::set<const Identifier*>& getDirectParents() const { return this->directParents_; } 132 132 /** @brief Returns the begin-iterator of the direct-parents-list. @return The begin-iterator */ 133 inline std:: list<const Identifier*>::const_iterator getDirectParentsBegin() const { return this->directParents_.begin(); }133 inline std::set<const Identifier*>::const_iterator getDirectParentsBegin() const { return this->directParents_.begin(); } 134 134 /** @brief Returns the end-iterator of the direct-parents-list. @return The end-iterator */ 135 inline std:: list<const Identifier*>::const_iterator getDirectParentsEnd() const { return this->directParents_.end(); }135 inline std::set<const Identifier*>::const_iterator getDirectParentsEnd() const { return this->directParents_.end(); } 136 136 137 137 /** @brief Returns the direct children the class the Identifier belongs to. @return The list of all direct children */ 138 inline const std:: list<const Identifier*>& getDirectChildren() const { return (*this->directChildren_); }138 inline const std::set<const Identifier*>& getDirectChildren() const { return (*this->directChildren_); } 139 139 /** @brief Returns the begin-iterator of the direct-children-list. @return The begin-iterator */ 140 inline std:: list<const Identifier*>::const_iterator getDirectChildrenBegin() const { return this->directChildren_->begin(); }140 inline std::set<const Identifier*>::const_iterator getDirectChildrenBegin() const { return this->directChildren_->begin(); } 141 141 /** @brief Returns the end-iterator of the direct-children-list. @return The end-iterator */ 142 inline std:: list<const Identifier*>::const_iterator getDirectChildrenEnd() const { return this->directChildren_->end(); }142 inline std::set<const Identifier*>::const_iterator getDirectChildrenEnd() const { return this->directChildren_->end(); } 143 143 144 144 /** @brief Returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents. @return The status of the class-hierarchy creation */ … … 159 159 virtual XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname) = 0; 160 160 virtual void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container) = 0; 161 162 static bool identifierIsInList(const Identifier* identifier, const std::list<const Identifier*>& list);163 161 164 162 private: … … 166 164 Identifier(const Identifier& identifier) {} // don't copy 167 165 virtual ~Identifier(); 168 void initialize(std:: list<const Identifier*>* parents);166 void initialize(std::set<const Identifier*>* parents); 169 167 170 168 /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */ 171 inline std:: list<const Identifier*>& getChildrenIntern() const { return (*this->children_); }169 inline std::set<const Identifier*>& getChildrenIntern() const { return (*this->children_); } 172 170 /** @brief Returns the direct children of the class the Identifier belongs to. @return The list of all direct children */ 173 inline std:: list<const Identifier*>& getDirectChildrenIntern() const { return (*this->directChildren_); }171 inline std::set<const Identifier*>& getDirectChildrenIntern() const { return (*this->directChildren_); } 174 172 175 173 /** … … 191 189 } 192 190 193 std:: list<const Identifier*> parents_; //!< The parents of the class the Identifier belongs to194 std:: list<const Identifier*>* children_; //!< The children of the class the Identifier belongs to195 196 std:: list<const Identifier*> directParents_; //!< The direct parents of the class the Identifier belongs to197 std:: list<const Identifier*>* directChildren_; //!< The direct children of the class the Identifier belongs to191 std::set<const Identifier*> parents_; //!< The parents of the class the Identifier belongs to 192 std::set<const Identifier*>* children_; //!< The children of the class the Identifier belongs to 193 194 std::set<const Identifier*> directParents_; //!< The direct parents of the class the Identifier belongs to 195 std::set<const Identifier*>* directChildren_; //!< The direct children of the class the Identifier belongs to 198 196 199 197 std::string name_; //!< The name of the class the Identifier belongs to … … 206 204 }; 207 205 208 std::ostream& operator<<(std::ostream& out, const std:: list<const Identifier*>& list);206 std::ostream& operator<<(std::ostream& out, const std::set<const Identifier*>& list); 209 207 210 208 … … 231 229 232 230 public: 233 ClassIdentifier<T>* registerClass(std:: list<const Identifier*>* parents, const std::string& name, bool bRootClass);231 ClassIdentifier<T>* registerClass(std::set<const Identifier*>* parents, const std::string& name, bool bRootClass); 234 232 void addObject(T* object); 235 233 void removeObjects() const; … … 273 271 */ 274 272 template <class T> 275 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(std:: list<const Identifier*>* parents, const std::string& name, bool bRootClass)273 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(std::set<const Identifier*>* parents, const std::string& name, bool bRootClass) 276 274 { 277 275 COUT(5) << "*** ClassIdentifier: Register Class in " << name << "-Singleton." << std::endl;
Note: See TracChangeset
for help on using the changeset viewer.