Mass++ Common Libraries v2.7.5
 All Classes Namespaces Files Functions Variables Enumerations Macros
SettingParameterValues.h
Go to the documentation of this file.
1 
12 #ifndef __KOME_OBJECTS_SETTING_PARAMETER_VALUES_H__
13 #define __KOME_OBJECTS_SETTING_PARAMETER_VALUES_H__
14 
15 
16 #include <string>
17 #include <vector>
18 #include <utility>
19 #include <boost/utility.hpp>
20 
21 
22 
23 #define MSPP_SETTINGS_NONE_VALUE "none"
24 
25 
26 namespace kome {
27  namespace objects {
28 
33  class DATA_OBJECTS_CLASS SettingParameterValues {
34  public:
40 
47 
52  virtual ~SettingParameterValues();
53 
54  protected:
59  struct SubSettingsKey {
60  std::string key;
61  std::string value;
62  };
63 
65  std::vector< std::pair< std::string, std::string > > m_values;
66 
68  std::vector< std::pair< SubSettingsKey, SettingParameterValues* > > m_itemValues;
69 
70  public:
77  SettingParameterValues& operator=( const SettingParameterValues& other );
78 
79  public:
84  void clear();
85 
86  protected:
93  int getIndex( const char* name );
94 
95  public:
102  void setValue( const unsigned int index, const char* value );
103 
110  void setValue( const char* name, const char* value );
111 
117  unsigned int getNumberOfParameters();
118 
125  const char* getParameterName( const unsigned int index );
126 
133  const char* getParameterValue( const unsigned int index );
134 
141  const char* getParameterValue( const char* name );
142 
150  bool getBoolValue( const unsigned int index, const bool df );
151 
159  bool getBoolValue( const char* name, const bool df );
160 
168  int getIntValue( const unsigned int index, const int df );
169 
177  int getIntValue( const char* name, const int df );
178 
186  double getDoubleValue( const unsigned int index, const double df );
187 
195  double getDoubleValue( const char* name, const double df );
196 
204  SettingParameterValues* getSubParameterValues( const char* key, const char* val = NULL );
205 
213  bool hasSubParameterValues( const char* key, const char* val = NULL );
214 
215  public:
227  static void writeAllChildParameters(
229  kome::core::Properties& props,
230  const char* prefix
231  );
232  };
233  }
234 }
235 
236 #endif // __KOME_OBJECTS_SETTING_PARAMETER_VALUES_H__
setting parameter values management class
keys and values management class
Definition: Properties.h:29
std::vector< std::pair< SubSettingsKey, SettingParameterValues * > > m_itemValues
#define NULL
Definition: CoreMacros.h:18
std::vector< std::pair< std::string, std::string > > m_values