Changeset 5774 for code/trunk/src/libraries/core/Identifier.h
- Timestamp:
- Sep 23, 2009, 11:31:02 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/Identifier.h
r5738 r5774 66 66 #include "ObjectList.h" 67 67 #include "ObjectListBase.h" 68 #include "Super.h"69 68 70 69 namespace orxonox … … 107 106 bool isDirectParentOf(const Identifier* identifier) const; 108 107 109 /** @brief Returns true if the class can be loaded through XML. */110 inline bool isLoadable() const { return this->bLoadable_; }111 /** @brief Set the class to be loadable through XML or not. */112 inline void setLoadable(bool bLoadable) { this->bLoadable_ = bLoadable; }113 114 108 /** @brief Returns the list of all existing objects of this class. @return The list */ 115 109 inline ObjectListBase* getObjects() const … … 181 175 182 176 183 /** @brief Returns the map that stores all console commands. @return The const_iterator */184 inline const std::map<std::string, ConsoleCommand*>& getConsoleCommandMap() const { return this->consoleCommands_; }185 /** @brief Returns a const_iterator to the beginning of the map that stores all console commands. @return The const_iterator */186 inline std::map<std::string, ConsoleCommand*>::const_iterator getConsoleCommandMapBegin() const { return this->consoleCommands_.begin(); }187 /** @brief Returns a const_iterator to the end of the map that stores all console commands. @return The const_iterator */188 inline std::map<std::string, ConsoleCommand*>::const_iterator getConsoleCommandMapEnd() const { return this->consoleCommands_.end(); }189 190 /** @brief Returns the map that stores all console commands with their names in lowercase. @return The const_iterator */191 inline const std::map<std::string, ConsoleCommand*>& getLowercaseConsoleCommandMap() const { return this->consoleCommands_LC_; }192 /** @brief Returns a const_iterator to the beginning of the map that stores all console commands with their names in lowercase. @return The const_iterator */193 inline std::map<std::string, ConsoleCommand*>::const_iterator getLowercaseConsoleCommandMapBegin() const { return this->consoleCommands_LC_.begin(); }194 /** @brief Returns a const_iterator to the end of the map that stores all console commands with their names in lowercase. @return The const_iterator */195 inline std::map<std::string, ConsoleCommand*>::const_iterator getLowercaseConsoleCommandMapEnd() const { return this->consoleCommands_LC_.end(); }196 197 /** @brief Returns the map that stores all XMLPort params. @return The const_iterator */198 inline const std::map<std::string, XMLPortParamContainer*>& getXMLPortParamMap() const { return this->xmlportParamContainers_; }199 /** @brief Returns a const_iterator to the beginning of the map that stores all XMLPort params. @return The const_iterator */200 inline std::map<std::string, XMLPortParamContainer*>::const_iterator getXMLPortParamMapBegin() const { return this->xmlportParamContainers_.begin(); }201 /** @brief Returns a const_iterator to the end of the map that stores all XMLPort params. @return The const_iterator */202 inline std::map<std::string, XMLPortParamContainer*>::const_iterator getXMLPortParamMapEnd() const { return this->xmlportParamContainers_.end(); }203 204 /** @brief Returns the map that stores all XMLPort objects. @return The const_iterator */205 inline const std::map<std::string, XMLPortObjectContainer*>& getXMLPortObjectMap() const { return this->xmlportObjectContainers_; }206 /** @brief Returns a const_iterator to the beginning of the map that stores all XMLPort objects. @return The const_iterator */207 inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortObjectMapBegin() const { return this->xmlportObjectContainers_.begin(); }208 /** @brief Returns a const_iterator to the end of the map that stores all XMLPort objects. @return The const_iterator */209 inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortObjectMapEnd() const { return this->xmlportObjectContainers_.end(); }210 211 /** @brief Returns the map that stores all XMLPort events. @return The const_iterator */212 inline const std::map<std::string, XMLPortObjectContainer*>& getXMLPortEventMap() const { return this->xmlportEventContainers_; }213 /** @brief Returns a const_iterator to the beginning of the map that stores all XMLPort events. @return The const_iterator */214 inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortEventMapBegin() const { return this->xmlportEventContainers_.begin(); }215 /** @brief Returns a const_iterator to the end of the map that stores all XMLPort events. @return The const_iterator */216 inline std::map<std::string, XMLPortObjectContainer*>::const_iterator getXMLPortEventMapEnd() const { return this->xmlportEventContainers_.end(); }217 218 177 /** @brief Returns true if this class has at least one config value. @return True if this class has at least one config value */ 219 178 inline bool hasConfigValues() const { return this->bHasConfigValues_; } 220 /** @brief Returns true if this class has at least one console command. @return True if this class has at least one console command */221 inline bool hasConsoleCommands() const { return this->bHasConsoleCommands_; }222 179 223 180 /** @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 */ 224 181 inline static bool isCreatingHierarchy() { return (hierarchyCreatingCounter_s > 0); } 225 226 /** @brief Returns the network ID to identify a class through the network. @return the network ID */227 inline const uint32_t getNetworkID() const { return this->networkID_; }228 229 /** @brief Sets the network ID to a new value. @param id The new value */230 void setNetworkID(uint32_t id);231 182 232 183 /** @brief Returns the unique ID of the class */ … … 236 187 ConfigValueContainer* getConfigValueContainer(const std::string& varname); 237 188 ConfigValueContainer* getLowercaseConfigValueContainer(const std::string& varname); 238 239 void addXMLPortParamContainer(const std::string& paramname, XMLPortParamContainer* container);240 XMLPortParamContainer* getXMLPortParamContainer(const std::string& paramname);241 242 void addXMLPortObjectContainer(const std::string& sectionname, XMLPortObjectContainer* container);243 XMLPortObjectContainer* getXMLPortObjectContainer(const std::string& sectionname);244 245 void addXMLPortEventContainer(const std::string& eventname, XMLPortObjectContainer* container);246 XMLPortObjectContainer* getXMLPortEventContainer(const std::string& eventname);247 248 ConsoleCommand& addConsoleCommand(ConsoleCommand* command, bool bCreateShortcut);249 ConsoleCommand* getConsoleCommand(const std::string& name) const;250 ConsoleCommand* getLowercaseConsoleCommand(const std::string& name) const;251 189 252 190 void initializeClassHierarchy(std::set<const Identifier*>* parents, bool bRootClass); … … 260 198 261 199 static Identifier* getIdentifierSingleton(const std::string& name, Identifier* proposal); 262 virtual void createSuperFunctionCaller() const = 0;263 200 264 201 /** @brief Returns the map that stores all Identifiers. @return The map */ … … 305 242 bool bCreatedOneObject_; //!< True if at least one object of the given type was created (used to determine the need of storing the parents) 306 243 bool bSetName_; //!< True if the name is set 307 bool bLoadable_; //!< False = it's not permitted to load the object through XML308 244 std::string name_; //!< The name of the class the Identifier belongs to 309 245 BaseFactory* factory_; //!< The Factory, able to create new objects of the given class (if available) 310 246 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) 311 uint32_t networkID_; //!< The network ID to identify a class through the network312 247 const unsigned int classID_; //!< Uniquely identifies a class (might not be the same as the networkID_) 313 248 static unsigned int classIDCounter_s; //!< Static counter for the unique classIDs … … 316 251 std::map<std::string, ConfigValueContainer*> configValues_; //!< A map to link the string of configurable variables with their ConfigValueContainer 317 252 std::map<std::string, ConfigValueContainer*> configValues_LC_; //!< A map to link the string of configurable variables with their ConfigValueContainer 318 319 bool bHasConsoleCommands_; //!< True if this class has at least one assigned console command320 std::map<std::string, ConsoleCommand*> consoleCommands_; //!< All console commands of this class321 std::map<std::string, ConsoleCommand*> consoleCommands_LC_; //!< All console commands of this class with their names in lowercase322 323 std::map<std::string, XMLPortParamContainer*> xmlportParamContainers_; //!< All loadable parameters324 std::map<std::string, XMLPortObjectContainer*> xmlportObjectContainers_; //!< All attachable objects325 std::map<std::string, XMLPortObjectContainer*> xmlportEventContainers_; //!< All events326 253 }; 327 254 … … 344 271 class ClassIdentifier : public Identifier 345 272 { 346 #define SUPER_INTRUSIVE_DECLARATION_INCLUDE347 #include "Super.h"348 349 273 public: 350 274 static ClassIdentifier<T> *getIdentifier(); … … 360 284 ClassIdentifier() 361 285 { 362 SuperFunctionInitialization<0, T>::initialize(this);363 286 } 364 287 ~ClassIdentifier() 365 288 { 366 SuperFunctionDestruction<0, T>::destroy(this);367 289 } 368 290 … … 630 552 { return this->identifier_; } 631 553 632 // /** @brief Returns true, if the assigned identifier is at least of the given type. @param identifier The identifier to compare with */633 // inline bool isA(const Identifier* identifier) const634 // { return this->identifier_->isA(identifier); }635 //636 // /** @brief Returns true, if the assigned identifier is exactly of the given type. @param identifier The identifier to compare with */637 // inline bool isExactlyA(const Identifier* identifier) const638 // { return this->identifier_->isExactlyA(identifier); }639 //640 // /** @brief Returns true, if the assigned identifier is a child of the given identifier. @param identifier The identifier to compare with */641 // inline bool isChildOf(const Identifier* identifier) const642 // { return this->identifier_->isChildOf(identifier); }643 //644 // /** @brief Returns true, if the assigned identifier is a direct child of the given identifier. @param identifier The identifier to compare with */645 // inline bool isDirectChildOf(const Identifier* identifier) const646 // { return this->identifier_->isDirectChildOf(identifier); }647 //648 // /** @brief Returns true, if the assigned identifier is a parent of the given identifier. @param identifier The identifier to compare with */649 // inline bool isParentOf(const Identifier* identifier) const650 // { return this->identifier_->isParentOf(identifier); }651 //652 // /** @brief Returns true, if the assigned identifier is a direct parent of the given identifier. @param identifier The identifier to compare with */653 // inline bool isDirectParentOf(const Identifier* identifier) const654 // { return this->identifier_->isDirectParentOf(identifier); }655 656 554 private: 657 555 Identifier* identifier_; //!< The assigned identifier
Note: See TracChangeset
for help on using the changeset viewer.