Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: orxonox.OLD/trunk/src/util/loading/load_param_description.h @ 5549

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

orxonox/trunk: cleanup of LoadParam

File size: 2.6 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 "base_object.h"
25
26// Forward Declaration //
27template<class T> class tList;
28
29/************************
30*** DESCRIPTION STUFF ***
31************************/
32//! A class that handles the description of loadable parameters
33class LoadParamDescription
34{
35  friend class LoadParamBase;
36  friend class LoadClassDescription;
37 public:
38  LoadParamDescription(const char* paramName);
39  ~LoadParamDescription();
40
41  void setDescription(const char* descriptionText);
42  /** @returns the descriptionString */
43  const char* getDescription() { return this->description; };
44
45  void print() const;
46 private:
47  char*         paramName;             //!< The name of the parameter.
48  int           paramCount;            //!< The count of parameters.
49  int*          types;                 //!< What kind of parameters does this function take ??
50  char*         description;           //!< A longer description about this function.
51  char**        defaultValues;         //!< The 'Default Values'.
52};
53
54//! A class for descriptions of a loadable module
55class LoadClassDescription
56{
57  friend class LoadParamBase;
58 public:
59  LoadClassDescription(const char* className);
60  ~LoadClassDescription();
61
62  static LoadClassDescription* addClass(const char* className);
63  LoadParamDescription* addParam(const char* paramName);
64
65  static void deleteAllDescriptions();
66
67  static void printAll(const char* fileName = NULL);
68  static tList<const char>* searchClassWithShort(const char* classNameBegin);
69//  static const LoadParamDescription* getClass(const char* className);
70
71 private:
72  static bool                          parametersDescription;  //!< if parameter-description should be enabled.
73  static tList<LoadClassDescription>*  classList;              //!< a list, that holds all the loadable classes. (after one instance has been loaded)
74  char*                                className;              //!< name of the class
75  tList<LoadParamDescription>*         paramList;              //!< List of parameters this class knows.
76};
77
78#endif /* _LOAD_PARAM_DESCRIPTION_H */
Note: See TracBrowser for help on using the repository browser.