Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 9, 2007, 11:21:14 PM (16 years ago)
Author:
landauf
Message:
  • added comments and doxygen-tags to the ConfigValueContainer
  • changed some comments in the other files
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
    115#ifndef _ConfigValueContainer_H__
    216#define _ConfigValueContainer_H__
     
    923namespace orxonox
    1024{
     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    */
    1141    class ConfigValueContainer
    1242    {
     
    2959            static void writeConfigFile(const std::string& filename);
    3060
     61            /** @returns the value of the type int. @param value This is only needed to determine the right type. */
    3162            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. */
    3264            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. */
    3366            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. */
    3468            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. */
    3570            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. */
    3672            inline Ogre::ColourValue getValue(const Ogre::ColourValue& value)   { return this->value_colourvalue_; }
    3773
    3874        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
    4278
    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
    4985
    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
    5389    };
    5490}
Note: See TracChangeset for help on using the changeset viewer.