Changeset 9767 in orxonox.OLD for branches/new_class_id/src/lib
- Timestamp:
- Sep 19, 2006, 5:58:08 PM (18 years ago)
- 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 35 35 ~LoadParamClassDescription(); 36 36 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; } 43 40 44 41 static void deleteAllDescriptions(); 42 43 45 44 46 45 static void printAll(const std::string& fileName = ""); … … 52 51 typedef std::set<LoadParamDescription> ParamDescriptionSet; 53 52 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. 57 54 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 57 private: 58 std::string _className; //!< name of the class 59 ParamDescriptionSet _parameters; //!< List of parameters this class knows. 59 60 }; 60 61 -
branches/new_class_id/src/lib/util/loading/load_param_description.cc
r9765 r9767 23 23 */ 24 24 LoadParamDescription::LoadParamDescription(const std::string& paramName) 25 : name(paramName)25 : _name(paramName) 26 26 { } 27 27 … … 38 38 void LoadParamDescription::setDescription(const std::string& descriptionText) 39 39 { 40 this-> description = descriptionText;40 this->_description = descriptionText; 41 41 } 42 42 … … 46 46 void LoadParamDescription::print() const 47 47 { 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++) 50 50 { 51 51 if (i > 0) … … 83 83 // } 84 84 } 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()); 88 88 // default values 89 if (this-> parameterCount > 0)89 if (this->_parameterCount > 0) 90 90 { 91 91 PRINT(3)(" (Default: "); 92 for (unsigned int i = 0; i < this-> parameterCount; i++)92 for (unsigned int i = 0; i < this->_parameterCount; i++) 93 93 { 94 94 if (i > 0) 95 95 PRINT(3)(", "); 96 if (this-> types[i] == "string")96 if (this->_types[i] == "string") 97 97 { // leave brackets !! 98 PRINT(3)("\"%s\"", this-> defaultValues[i].c_str());98 PRINT(3)("\"%s\"", this->_defaultValues[i].c_str()); 99 99 } 100 100 else 101 101 { 102 PRINT(3)("%s", this-> defaultValues[i].c_str());102 PRINT(3)("%s", this->_defaultValues[i].c_str()); 103 103 } 104 104 } -
branches/new_class_id/src/lib/util/loading/load_param_description.h
r9765 r9767 38 38 ~LoadParamDescription(); 39 39 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; }; 43 43 44 44 void setDescription(const std::string& descriptionText); 45 45 /** @returns the descriptionString */ 46 const std::string& getDescription() { return this->description; };46 const std::string& description() { return this->_description; }; 47 47 48 48 void print() const; 49 49 50 50 private: 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. 54 54 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; 58 57 }; 59 58
Note: See TracChangeset
for help on using the changeset viewer.