Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9767 in orxonox.OLD for branches/new_class_id/src/lib


Ignore:
Timestamp:
Sep 19, 2006, 5:58:08 PM (18 years ago)
Author:
bensch
Message:

compiles again for real… this time it is true :)

Location:
branches/new_class_id/src/lib/util/loading
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/util/loading/load_param_class_description.h

    r9765 r9767  
    3535  ~LoadParamClassDescription();
    3636
    37   bool operator==(const std::string& className) const { return this->className == className; };
    38   bool operator==(const LoadParamClassDescription& classDescr) const { return this->className == classDescr.className; };
    39   bool operator<(const LoadParamClassDescription& classDescr) const { return this->className < classDescr.className; }
    40 
    41   static LoadParamClassDescription* addClass(const std::string& className);
    42   LoadParamDescription* addParam(const std::string& paramName);
     37  bool operator==(const std::string& className) const { return this->_className == className; };
     38  bool operator==(const LoadParamClassDescription& classDescr) const { return this->_className == classDescr._className; };
     39  bool operator<(const LoadParamClassDescription& classDescr) const { return this->_className < classDescr._className; }
    4340
    4441  static void deleteAllDescriptions();
     42
     43
    4544
    4645  static void printAll(const std::string& fileName = "");
     
    5251  typedef std::set<LoadParamDescription>       ParamDescriptionSet;
    5352
    54   static bool                                  parametersDescription;  //!< if parameter-description should be enabled.
    55   static ClassDescriptionSet*                  classList;              //!< a list, that stores all the loadable classes. (after one instance has been loaded)
    56   std::string                                  className;              //!< name of the class
     53  static bool                                  _parametersDescription;  //!< if parameter-description should be enabled globally.
    5754
    58   ParamDescriptionSet                          parameters;              //!< List of parameters this class knows.
     55  static ClassDescriptionSet*                  _classList;              //!< a list, that stores all the loadable classes. (after one instance has been loaded)
     56
     57private:
     58  std::string                                  _className;              //!< name of the class
     59  ParamDescriptionSet                          _parameters;              //!< List of parameters this class knows.
    5960};
    6061
  • branches/new_class_id/src/lib/util/loading/load_param_description.cc

    r9765 r9767  
    2323 */
    2424LoadParamDescription::LoadParamDescription(const std::string& paramName)
    25   : name(paramName)
     25  : _name(paramName)
    2626{ }
    2727
     
    3838void LoadParamDescription::setDescription(const std::string& descriptionText)
    3939{
    40   this->description = descriptionText;
     40  this->_description = descriptionText;
    4141}
    4242
     
    4646void LoadParamDescription::print() const
    4747{
    48   PRINT(3)(" <%s>", this->name.c_str());
    49   for (unsigned int i = 0; i < this->parameterCount; i++)
     48  PRINT(3)(" <%s>", this->_name.c_str());
     49  for (unsigned int i = 0; i < this->_parameterCount; i++)
    5050  {
    5151    if (i > 0)
     
    8383//     }
    8484  }
    85   PRINT(3)("</%s>", this->name.c_str());
    86   if (!this->description.empty())
    87     PRINT(3)(" -- %s", this->description.c_str());
     85  PRINT(3)("</%s>", this->_name.c_str());
     86  if (!this->_description.empty())
     87    PRINT(3)(" -- %s", this->_description.c_str());
    8888  // default values
    89   if (this->parameterCount > 0)
     89  if (this->_parameterCount > 0)
    9090  {
    9191    PRINT(3)(" (Default: ");
    92     for (unsigned int i = 0; i < this->parameterCount; i++)
     92    for (unsigned int i = 0; i < this->_parameterCount; i++)
    9393    {
    9494      if (i > 0)
    9595        PRINT(3)(", ");
    96       if (this->types[i] == "string")
     96      if (this->_types[i] == "string")
    9797      { // leave brackets !!
    98         PRINT(3)("\"%s\"", this->defaultValues[i].c_str());
     98        PRINT(3)("\"%s\"", this->_defaultValues[i].c_str());
    9999      }
    100100      else
    101101      {
    102         PRINT(3)("%s", this->defaultValues[i].c_str());
     102        PRINT(3)("%s", this->_defaultValues[i].c_str());
    103103      }
    104104    }
  • branches/new_class_id/src/lib/util/loading/load_param_description.h

    r9765 r9767  
    3838  ~LoadParamDescription();
    3939
    40   bool operator==(const std::string& paramName) const { return this->name == paramName; };
    41   bool operator==(const LoadParamDescription& paramDescr) const { return this->name == paramDescr.name; };
    42   bool operator<(const LoadParamDescription& paramDescr) const { return this->name < paramDescr.name; };
     40  bool operator==(const std::string& paramName) const { return this->_name == paramName; };
     41  bool operator==(const LoadParamDescription& paramDescr) const { return this->_name == paramDescr._name; };
     42  bool operator<(const LoadParamDescription& paramDescr) const { return this->_name < paramDescr._name; };
    4343
    4444  void setDescription(const std::string& descriptionText);
    4545  /** @returns the descriptionString */
    46   const std::string& getDescription() { return this->description; };
     46  const std::string& description() { return this->_description; };
    4747
    4848  void print() const;
    4949
    5050private:
    51   const std::string          name;                  //!< The Name of the Parameter.
    52   unsigned int               parameterCount;        //!< The Count of parameters.
    53   std::string                description;           //!< A longer description about this function.
     51  const std::string          _name;                  //!< The Name of the Parameter.
     52  unsigned int               _parameterCount;        //!< The Count of parameters.
     53  std::string                _description;           //!< A longer description about this function.
    5454
    55   std::vector<std::string>   types;
    56   std::vector<std::string>   defaultValues;
    57 
     55  std::vector<std::string>   _types;
     56  std::vector<std::string>   _defaultValues;
    5857};
    5958
Note: See TracChangeset for help on using the changeset viewer.