[4592] | 1 | /* |
---|
[4250] | 2 | orxonox - the future of 3D-vertical-scrollers |
---|
[4233] | 3 | |
---|
[4250] | 4 | Copyright (C) 2004 orx |
---|
| 5 | |
---|
| 6 | This program is free software; you can redistribute it and/or modify |
---|
| 7 | it under the terms of the GNU General Public License as published by |
---|
| 8 | the Free Software Foundation; either version 2, or (at your option) |
---|
| 9 | any later version. |
---|
| 10 | |
---|
| 11 | ### File Specific: |
---|
| 12 | main-programmer: Benjamin Grauer |
---|
| 13 | co-programmer: ... |
---|
| 14 | */ |
---|
| 15 | |
---|
[4592] | 16 | /*! |
---|
[9765] | 17 | * @file load_param_class_description.h |
---|
[5129] | 18 | * A Class and macro-functions, that makes our lives easy to load-in parameters |
---|
| 19 | */ |
---|
[4250] | 20 | |
---|
[9765] | 21 | #ifndef _LOAD_PARAM_CLASS_DESCRIPTION_H |
---|
| 22 | #define _LOAD_PARAM_CLASS_DESCRIPTION_H |
---|
[4233] | 23 | |
---|
[9765] | 24 | #include "load_param_description.h" |
---|
[9771] | 25 | #include "class_id.h" |
---|
| 26 | #include <map> |
---|
[9765] | 27 | #include <set> |
---|
[4251] | 28 | // Forward Declaration // |
---|
[5556] | 29 | class MultiType; |
---|
[4251] | 30 | |
---|
[9765] | 31 | //! A class for descriptions of a loadable module |
---|
| 32 | class LoadParamClassDescription |
---|
[5332] | 33 | { |
---|
[7221] | 34 | public: |
---|
[9771] | 35 | LoadParamClassDescription(const std::string& className = ""); |
---|
[9765] | 36 | ~LoadParamClassDescription(); |
---|
[5332] | 37 | |
---|
[9767] | 38 | bool operator==(const std::string& className) const { return this->_className == className; }; |
---|
| 39 | bool operator==(const LoadParamClassDescription& classDescr) const { return this->_className == classDescr._className; }; |
---|
| 40 | bool operator<(const LoadParamClassDescription& classDescr) const { return this->_className < classDescr._className; } |
---|
[5332] | 41 | |
---|
| 42 | |
---|
[9771] | 43 | static void describeClass(const ClassID& classID, |
---|
| 44 | const std::string& paramName, |
---|
| 45 | const std::string& descriptionText); |
---|
| 46 | static void setValuesOf(const ClassID& classID, |
---|
| 47 | const std::string& paramName, |
---|
| 48 | unsigned int paramCount, |
---|
| 49 | const MultiType* const defaultValues, |
---|
| 50 | bool retVal = false); |
---|
[9767] | 51 | |
---|
[9771] | 52 | static void deleteAllDescriptions(); |
---|
[9767] | 53 | |
---|
[7221] | 54 | static void printAll(const std::string& fileName = ""); |
---|
[5332] | 55 | |
---|
[7221] | 56 | private: |
---|
[9771] | 57 | typedef std::map<ClassID, LoadParamClassDescription> ClassDescriptionMap; |
---|
| 58 | typedef std::map<std::string, LoadParamDescription> ParamDescriptionMap; |
---|
[9765] | 59 | |
---|
[9771] | 60 | private: |
---|
| 61 | static ParamDescriptionMap::iterator getParamDescription(const ClassID& classID, const std::string& paramName); |
---|
| 62 | |
---|
| 63 | private: |
---|
| 64 | |
---|
[9767] | 65 | static bool _parametersDescription; //!< if parameter-description should be enabled globally. |
---|
[5556] | 66 | |
---|
[9771] | 67 | static ClassDescriptionMap _classList; //!< a list, that stores all the loadable classes. (after one instance has been loaded) |
---|
[9767] | 68 | |
---|
| 69 | private: |
---|
| 70 | std::string _className; //!< name of the class |
---|
[9771] | 71 | ParamDescriptionMap _parameters; //!< List of parameters this class knows. |
---|
[5332] | 72 | }; |
---|
| 73 | |
---|
[9765] | 74 | #endif /* _LOAD_PARAM_CLASS_DESCRIPTION_H */ |
---|