Changeset 434 for code/branches/objecthierarchy/src/orxonox/core
- Timestamp:
- Dec 8, 2007, 5:37:26 PM (17 years ago)
- Location:
- code/branches/objecthierarchy/src/orxonox/core
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/core/Identifier.h
r365 r434 25 25 26 26 #include <iostream> 27 #include <map> 27 28 28 29 #include "IdentifierList.h" 29 30 #include "ObjectList.h" 30 31 #include "Factory.h" 31 32 #define HIERARCHY_VERBOSE false 32 #include "ConfigValueContainer.h" 33 34 #define HIERARCHY_VERBOSE 0 33 35 34 36 … … 93 95 void setNetworkID(unsigned int id); 94 96 97 inline ConfigValueContainer* getConfigValueContainer(const std::string& varname) 98 { return this->configValues_[varname]; } 99 100 inline void setConfigValueContainer(const std::string& varname, ConfigValueContainer* container) 101 { this->configValues_[varname] = container; } 102 95 103 private: 96 104 Identifier(); … … 121 129 } 122 130 123 IdentifierList parents_; //!< The Parents of the class the Identifier belongs to 124 IdentifierList* children_; //!< The Children of the class the Identifier belongs to 125 126 std::string name_; //!< The name of the class the Identifier belongs to 127 128 BaseFactory* factory_; //!< The Factory, able to create new objects of the given class 129 bool bCreatedOneObject_; //!< True if at least one object of the given type was created (used to determine the need of storing the parents) 130 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) 131 static unsigned int classIDcounter_s; //!< The number of unique Identifiers 132 unsigned int classID_; //!< The networkID to identify a class through the network 131 IdentifierList parents_; //!< The Parents of the class the Identifier belongs to 132 IdentifierList* children_; //!< The Children of the class the Identifier belongs to 133 134 std::string name_; //!< The name of the class the Identifier belongs to 135 136 BaseFactory* factory_; //!< The Factory, able to create new objects of the given class 137 bool bCreatedOneObject_; //!< True if at least one object of the given type was created (used to determine the need of storing the parents) 138 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) 139 static unsigned int classIDcounter_s; //!< The number of unique Identifiers 140 unsigned int classID_; //!< The networkID to identify a class through the network 141 std::map<std::string, ConfigValueContainer*> configValues_; 133 142 }; 134 143 -
code/branches/objecthierarchy/src/orxonox/core/IdentifierIncludes.h
r365 r434 16 16 #include "Iterator.h" 17 17 #include "OrxonoxClass.h" 18 #include "ConfigValueContainer.h" 18 19 20 #include "OgreVector3.h" 21 #include "OgreColourValue.h" 22 23 namespace orxonox 24 { 25 typedef Ogre::Vector3 Vector3; 26 typedef Ogre::ColourValue ColourValue; 27 } 19 28 20 29 // Intern macro, containing the common parts of RegisterObject and RegisterRootObject … … 62 71 #define ID(StringOrInt) \ 63 72 Factory::getIdentifier(StringOrInt) 73 74 // bla 75 #define SetConfigValue(varname, defvalue) \ 76 ConfigValueContainer* container##varname = this->getIdentifier()->getConfigValueContainer(#varname); \ 77 if (!container##varname) \ 78 { \ 79 container##varname = new ConfigValueContainer(this->getIdentifier()->getName(), #varname, defvalue); \ 80 this->getIdentifier()->setConfigValueContainer(#varname, container##varname); \ 81 } \ 82 this->varname = container##varname->getValue(varname) -
code/branches/objecthierarchy/src/orxonox/core/OrxonoxClass.h
r366 r434 27 27 OrxonoxClass(); 28 28 virtual ~OrxonoxClass(); 29 30 void setConfigValues() {}; 29 31 30 32 /** @returns the Identifier of the object */
Note: See TracChangeset
for help on using the changeset viewer.