Changeset 9869 in orxonox.OLD for trunk/src/lib/util/loading/load_param_description.h
- Timestamp:
- Oct 3, 2006, 12:19:30 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/util/loading/load_param_description.h
r7221 r9869 15 15 16 16 /*! 17 * @file load_param .h17 * @file load_param_description.h 18 18 * A Class and macro-functions, that makes our lives easy to load-in parameters 19 19 */ … … 22 22 #define _LOAD_PARAM_DESCRIPTION_H 23 23 24 #include "base_object.h"25 #include < list>24 #include <vector> 25 #include <string> 26 26 27 27 // Forward Declaration // … … 34 34 class LoadParamDescription 35 35 { 36 friend class LoadParam;37 friend class LoadClassDescription;38 36 public: 39 LoadParamDescription(const std::string& paramName); 40 ~LoadParamDescription(); 37 LoadParamDescription(const std::string& paramName = ""); 38 39 //! Compares a LoadParamDescription with a String. 40 bool operator==(const std::string& paramName) const { return this->_name == paramName; }; 41 //! Compares two LoadParamDescription 42 bool operator==(const LoadParamDescription& paramDescr) const { return this->_name == paramDescr._name; }; 43 //! Compares two LoadParamDescription with the less operator 44 bool operator<(const LoadParamDescription& paramDescr) const { return this->_name < paramDescr._name; }; 41 45 42 46 void setDescription(const std::string& descriptionText); 47 void setValues(unsigned int paramCount, 48 const MultiType* const defaultValues, 49 bool retVal = false); 50 43 51 /** @returns the descriptionString */ 44 const std::string& getDescription() { return this->description; };52 const std::string& description() { return this->_description; }; 45 53 46 void print( ) const;54 void print(FILE* stream = stdout, bool withComments = true) const; 47 55 48 56 private: 49 std::string paramName; //!< The name of the parameter. 50 int paramCount; //!< The count of parameters. 51 int* types; //!< What kind of parameters does this function take ?? 52 std::string description; //!< A longer description about this function. 53 char** defaultValues; //!< The 'Default Values'. @TODO MAKE THIS A MULTITYPE 54 }; 57 std::string _name; //!< The Name of the Parameter. 58 unsigned int _parameterCount; //!< The Count of parameters. 59 std::string _description; //!< A longer description about this function. 55 60 56 //! A class for descriptions of a loadable module 57 class LoadClassDescription 58 { 59 friend class CLoadParam; 60 public: 61 LoadClassDescription(const std::string& className); 62 ~LoadClassDescription(); 63 64 static LoadClassDescription* addClass(const std::string& className); 65 LoadParamDescription* addParam(const std::string& paramName); 66 67 static void deleteAllDescriptions(); 68 69 static void printAll(const std::string& fileName = ""); 70 static std::list<std::string> searchClassWithShort(const std::string& classNameBegin); 71 // static const LoadParamDescription* getClass(const std::string& className); 72 73 private: 74 static bool parametersDescription; //!< if parameter-description should be enabled. 75 static std::list<LoadClassDescription*>* classList; //!< a list, that stores all the loadable classes. (after one instance has been loaded) 76 std::string className; //!< name of the class 77 78 std::list<LoadParamDescription*> paramList; //!< List of parameters this class knows. 61 std::vector<std::string> _types; //!< A Vector of types of this Parameter. 62 std::vector<std::string> _defaultValues; //!< A Vector of defaultValues of this Parameter. 79 63 }; 80 64
Note: See TracChangeset
for help on using the changeset viewer.