1 | /* |
---|
2 | orxonox - the future of 3D-vertical-scrollers |
---|
3 | |
---|
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 | |
---|
16 | /*! |
---|
17 | * @file load_param_class_description.h |
---|
18 | * A Class and macro-functions, that makes our lives easy to load-in parameters |
---|
19 | */ |
---|
20 | |
---|
21 | #ifndef _LOAD_PARAM_CLASS_DESCRIPTION_H |
---|
22 | #define _LOAD_PARAM_CLASS_DESCRIPTION_H |
---|
23 | |
---|
24 | #include "load_param_description.h" |
---|
25 | #include <set> |
---|
26 | |
---|
27 | // Forward Declaration // |
---|
28 | class MultiType; |
---|
29 | |
---|
30 | //! A class for descriptions of a loadable module |
---|
31 | class LoadParamClassDescription |
---|
32 | { |
---|
33 | public: |
---|
34 | LoadParamClassDescription(const std::string& className); |
---|
35 | ~LoadParamClassDescription(); |
---|
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); |
---|
43 | |
---|
44 | static void deleteAllDescriptions(); |
---|
45 | |
---|
46 | static void printAll(const std::string& fileName = ""); |
---|
47 | static std::list<std::string> searchClassWithShort(const std::string& classNameBegin); |
---|
48 | // static const LoadParamDescription* getClass(const std::string& className); |
---|
49 | |
---|
50 | private: |
---|
51 | typedef std::set<LoadParamClassDescription> ClassDescriptionSet; |
---|
52 | typedef std::set<LoadParamDescription> ParamDescriptionSet; |
---|
53 | |
---|
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 |
---|
57 | |
---|
58 | ParamDescriptionSet parameters; //!< List of parameters this class knows. |
---|
59 | }; |
---|
60 | |
---|
61 | #endif /* _LOAD_PARAM_CLASS_DESCRIPTION_H */ |
---|