- Timestamp:
- Dec 9, 2007, 11:21:14 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/objecthierarchy/src/orxonox/core/ConfigValueContainer.h
r434 r447 1 /*! 2 @file ConfigValueContainer.h 3 @brief Definition of the ConfigValueContainer class. 4 5 The ConfigValueContainer class contains all needed informations about a configurable variable: 6 - the name of the variable 7 - the name of the class the variable belongs to 8 - the default value 9 - the user-specified value 10 - a pointer to the entry in the config-file 11 12 This is needed to assign the configured values to all newly created objects. 13 */ 14 1 15 #ifndef _ConfigValueContainer_H__ 2 16 #define _ConfigValueContainer_H__ … … 9 23 namespace orxonox 10 24 { 25 //! The ConfigValuecontainer contains all needed informations about a configurable variable. 26 /** 27 The ConfigValueContainer class contains all needed informations about a configurable variable: 28 - the name of the variable 29 - the name of the class the variable belongs to 30 - the default value 31 - the user-specified value 32 - a pointer to the entry in the config-file 33 34 This is needed to assign the configured values to all newly created objects. 35 36 The container searches for the entry in the config file. 37 If there is an entry, it parses the specified value and assigns it to the variable of the right type. 38 If there is no entry, it adds the entry with the default-value to the section of the variables class. 39 If there is no section, the section and the entry are added to the end of the config-file. 40 */ 11 41 class ConfigValueContainer 12 42 { … … 29 59 static void writeConfigFile(const std::string& filename); 30 60 61 /** @returns the value of the type int. @param value This is only needed to determine the right type. */ 31 62 inline int getValue(int value) { return this->value_int_; } 63 /** @returns the value of the type double. @param value This is only needed to determine the right type. */ 32 64 inline double getValue(double value) { return this->value_double_; } 65 /** @returns the value of the type bool. @param value This is only needed to determine the right type. */ 33 66 inline bool getValue(bool value) { return this->value_bool_; } 67 /** @returns the value of the type std::string. @param value This is only needed to determine the right type. */ 34 68 inline std::string getValue(const std::string& value) { return this->value_string_; } 69 /** @returns the value of the type Vector3. @param value This is only needed to determine the right type. */ 35 70 inline Ogre::Vector3 getValue(const Ogre::Vector3& value) { return this->value_vector3_; } 71 /** @returns the value of the type Colour£Value. @param value This is only needed to determine the right type. */ 36 72 inline Ogre::ColourValue getValue(const Ogre::ColourValue& value) { return this->value_colourvalue_; } 37 73 38 74 private: 39 std::string classname_; 40 std::string varname_; 41 std::string defvalue_; 75 std::string classname_; //!< The name of the class the variable belongs to 76 std::string varname_; //!< The name of the variable 77 std::string defvalue_; //!< The string of the default-variable 42 78 43 int value_int_; 44 double value_double_; 45 bool value_bool_; 46 std::string value_string_; 47 Ogre::Vector3 value_vector3_; 48 Ogre::ColourValue value_colourvalue_; 79 int value_int_; //!< The value, if the variable is of the type int 80 double value_double_; //!< The value, if the variable is of the type double 81 bool value_bool_; //!< The value, if the variable is of the type bool 82 std::string value_string_; //!< The value, if the variable is of the type string 83 Ogre::Vector3 value_vector3_; //!< The value, if the variable is of the type Vector3 84 Ogre::ColourValue value_colourvalue_; //!< The value, if the variable is of the type ColourValue 49 85 50 std::list<std::string>::iterator configFileLine_; 51 static std::list<std::string>* configFileLines_s; 52 static bool readConfigFile_s; 86 std::list<std::string>::iterator configFileLine_; //!< An iterator, pointing to the entry of the variable in the config-file 87 static std::list<std::string>* configFileLines_s; //!< A list, containing all entrys in the config-file 88 static bool readConfigFile_s; //!< True if the config-file is read and stored in the list 53 89 }; 54 90 }
Note: See TracChangeset
for help on using the changeset viewer.