Changeset 813 for code/branches/core/src/orxonox/core/Identifier.h
- Timestamp:
- Feb 15, 2008, 4:31:58 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core/src/orxonox/core/Identifier.h
r812 r813 26 26 */ 27 27 28 /* !28 /** 29 29 @file Identifier.h 30 30 @brief Definition of the Identifier, ClassIdentifier and SubclassIdentifier classes, implementation of the ClassIdentifier and SubclassIdentifier classes. … … 52 52 #define _Identifier_H__ 53 53 54 #include <list> 54 55 #include <map> 55 56 #include <string> … … 59 60 60 61 #include "ObjectList.h" 61 #include "IdentifierList.h"62 //#include "IdentifierList.h" 62 63 #include "Debug.h" 63 64 #include "Iterator.h" … … 109 110 virtual void removeObjects() const = 0; 110 111 111 /** @ returns the name of the class the Identifier belongs to.*/112 /** @brief Returns the name of the class the Identifier belongs to. @return The name */ 112 113 inline const std::string& getName() const { return this->name_; } 113 114 114 /** @ returns the parents of the class the Identifier belongs to.*/115 inline const IdentifierList& getParents() const { return this->parents_; }116 117 /** @returns the children of the class the Identifier belongs to.*/118 inline IdentifierList& getChildren() const { return *this->children_; }119 120 /** @ returns true, if a branch of the class-hierarchy is being created, causing all new objects to store their parents.*/115 /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */ 116 inline const std::list<const Identifier*>& getParents() const { return this->parents_; } 117 118 // /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */ 119 // inline const std::list<const Identifier*>& getChildren() const { return (*this->children_); } 120 121 /** @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 */ 121 122 inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); } 122 123 123 /** @ returns the network ID to identify a class through the network.*/124 /** @brief Returns the network ID to identify a class through the network. @return the network ID */ 124 125 inline const unsigned int getNetworkID() const { return this->classID_; } 125 126 … … 127 128 void setNetworkID(unsigned int id); 128 129 129 /** @ returns the ConfigValueContainer of a variable, given by the string of its name. @param varname The name of the variable*/130 /** @brief Returns the ConfigValueContainer of a variable, given by the string of its name. @param varname The name of the variable @return The ConfigValueContainer */ 130 131 inline ConfigValueContainer* getConfigValueContainer(const std::string& varname) 131 132 { return this->configValues_[varname]; } … … 139 140 Identifier(const Identifier& identifier) {} // don't copy 140 141 virtual ~Identifier(); 141 void initialize(const IdentifierList* parents); 142 void initialize(std::list<const Identifier*>* parents); 143 144 /** @brief Returns the parents of the class the Identifier belongs to. @return The list of all parents */ 145 inline std::list<const Identifier*>& getParents() { return this->parents_; } 146 147 /** @brief Returns the children of the class the Identifier belongs to. @return The list of all children */ 148 inline std::list<const Identifier*>& getChildren() const { return (*this->children_); } 142 149 143 150 /** … … 159 166 } 160 167 161 IdentifierList parents_; //!< The Parents of the class the Identifier belongs to 162 IdentifierList* children_; //!< The Children of the class the Identifier belongs to 168 static bool identifierIsInList(const Identifier* identifier, const std::list<const Identifier*>& list); 169 170 // IdentifierList parents_; //!< The Parents of the class the Identifier belongs to 171 // IdentifierList* children_; //!< The Children of the class the Identifier belongs to 172 std::list<const Identifier*> parents_; //!< The Parents of the class the Identifier belongs to 173 std::list<const Identifier*>* children_; //!< The Children of the class the Identifier belongs to 163 174 164 175 std::string name_; //!< The name of the class the Identifier belongs to … … 194 205 195 206 public: 196 ClassIdentifier<T>* registerClass( const IdentifierList* parents, const std::string& name, bool bRootClass);207 ClassIdentifier<T>* registerClass(std::list<const Identifier*>* parents, const std::string& name, bool bRootClass); 197 208 void addObject(T* object); 198 209 void removeObjects() const; … … 220 231 /** 221 232 @brief Registers a class, which means that the name and the parents get stored. 222 @param parents A n IdentifierList, containing the Identifiers of all parents of the class233 @param parents A list, containing the Identifiers of all parents of the class 223 234 @param name A string, containing exactly the name of the class 224 235 @param bRootClass True if the class is either an Interface or the BaseObject itself … … 226 237 */ 227 238 template <class T> 228 ClassIdentifier<T>* ClassIdentifier<T>::registerClass( const IdentifierList* parents, const std::string& name, bool bRootClass)239 ClassIdentifier<T>* ClassIdentifier<T>::registerClass(std::list<const Identifier*>* parents, const std::string& name, bool bRootClass) 229 240 { 230 241 COUT(4) << "*** ClassIdentifier: Register Class in " << name << "-Singleton." << std::endl; … … 383 394 } 384 395 385 /** @ returns the assigned identifier.*/396 /** @brief Returns the assigned identifier. @return The identifier */ 386 397 inline const Identifier* getIdentifier() const 387 398 { return this->identifier_; } 388 399 389 /** @ returns true, if the assigned identifier is at least of the given type. @param identifier The identifier to compare with */400 /** @brief Returns true, if the assigned identifier is at least of the given type. @param identifier The identifier to compare with */ 390 401 inline bool isA(const Identifier* identifier) const 391 402 { return this->identifier_->isA(identifier); } 392 403 393 /** @ returns true, if the assigned identifier is exactly of the given type. @param identifier The identifier to compare with */404 /** @brief Returns true, if the assigned identifier is exactly of the given type. @param identifier The identifier to compare with */ 394 405 inline bool isDirectlyA(const Identifier* identifier) const 395 406 { return this->identifier_->isDirectlyA(identifier); } 396 407 397 /** @ returns true, if the assigned identifier is a child of the given identifier. @param identifier The identifier to compare with */408 /** @brief Returns true, if the assigned identifier is a child of the given identifier. @param identifier The identifier to compare with */ 398 409 inline bool isChildOf(const Identifier* identifier) const 399 410 { return this->identifier_->isChildOf(identifier); } 400 411 401 /** @ returns true, if the assigned identifier is a parent of the given identifier. @param identifier The identifier to compare with */412 /** @brief Returns true, if the assigned identifier is a parent of the given identifier. @param identifier The identifier to compare with */ 402 413 inline bool isParentOf(const Identifier* identifier) const 403 414 { return this->identifier_->isParentOf(identifier); }
Note: See TracChangeset
for help on using the changeset viewer.