Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/branches/new_class_id/src/lib/util/loading/load_param_description.h @ 9764

Last change on this file since 9764 was 9764, checked in by bensch, 18 years ago

new load_param_descriptions

File size: 2.5 KB
Line 
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.h
18 * A Class and macro-functions, that makes our lives easy to load-in parameters
19 */
20
21#ifndef _LOAD_PARAM_DESCRIPTION_H
22#define _LOAD_PARAM_DESCRIPTION_H
23
24#include <list>
25#include <string>
26
27// Forward Declaration //
28class MultiType;
29
30/************************
31*** DESCRIPTION STUFF ***
32************************/
33//! A class that handles the description of loadable parameters
34class LoadParamDescription
35{
36  friend class LoadParam;
37  friend class LoadClassDescription;
38public:
39  LoadParamDescription(const std::string& paramName);
40  ~LoadParamDescription();
41
42  void setDescription(const std::string& descriptionText);
43  /** @returns the descriptionString */
44  const std::string& getDescription() { return this->description; };
45
46  void print() const;
47
48private:
49  std::string                description;           //!< A longer description about this function.
50
51  std::vector<std::string>   parameters;
52  std::vector<std::string>   defaultValues;
53
54};
55
56
57
58
59//! A class for descriptions of a loadable module
60class LoadClassDescription
61{
62  friend class LoadParamBase;
63public:
64  LoadClassDescription(const std::string& className);
65  ~LoadClassDescription();
66
67  static LoadClassDescription* addClass(const std::string& className);
68  LoadParamDescription* addParam(const std::string& paramName);
69
70  static void deleteAllDescriptions();
71
72  static void printAll(const std::string& fileName = "");
73  static std::list<std::string> searchClassWithShort(const std::string& classNameBegin);
74  //  static const LoadParamDescription* getClass(const std::string& className);
75
76private:
77  static bool                                  parametersDescription;  //!< if parameter-description should be enabled.
78  static std::vector<LoadClassDescription*>*   classList;              //!< a list, that stores all the loadable classes. (after one instance has been loaded)
79  std::string                                  className;              //!< name of the class
80
81  std::vector<LoadParamDescription*>           paramList;              //!< List of parameters this class knows.
82};
83
84#endif /* _LOAD_PARAM_DESCRIPTION_H */
Note: See TracBrowser for help on using the repository browser.