vrecko
virtual reality framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
configuration.h
Go to the documentation of this file.
1 #ifndef CONFIGURATION_H_
2 #define CONFIGURATION_H_
3 
4 #include <sstream>
5 #include <map>
6 #include <boost/program_options.hpp>
7 
8 using namespace boost::program_options;
9 using std::vector;
10 using std::string;
11 
12 namespace AP_LSystem {
13 
18 {
19  LS_0L = 0x00000001,
20  LS_1LL = 0x00000002,
21  LS_1LR = 0x00000004,
22  LS_2L = 0x00000008,
23  LS_IL = 0x00000080,
24  LS_DETERMINISTIC = 0x00000100,
25  LS_STOCHASTIC = 0x00000200,
26  LS_PARAMETRIC = 0x00010000,
27 };
28 
35 {
36 private:
37  static Configuration* config;
38 
39  options_description description;
40  variables_map globalProperties;
41  std::vector<variables_map> lsystemProperties;
42  std::map<std::string, int> lsystemNameMap;
43 
47  Configuration();
48 
52  ~Configuration();
53 public:
59  bool loadCfgFile(string filename);
60 
65  void setProperty(const string & prop);
66 
72  void setProperty(const string & lsystemID, const string & prop);
73 
80  void setProperty(const string & lsystemID, const string & prop, const string & value);
81 
87  const int getLSystemIndex( const string & lsystemID );
88 
93  const int getLSystemCount();
94 
100  const variable_value * getProperty(const string & prop);
101 
108  const variable_value * getProperty(const string & lsystemID, const string & prop);
109 
110 
117  const variable_value * getProperty(const unsigned int lsystemIndex, const string & prop);
118 
123  static Configuration * get();
124 
128  const void writeAll( std::basic_ostream<char> &, const string & );
129 };
130 }
131 
132 #endif