Medical Imaging Interaction Toolkit  2018.4.99-12ad79a3
Medical Imaging Interaction Toolkit
mitkConfigurationHolder.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 
14 #ifndef mitkConfigurationHolder_h
15 #define mitkConfigurationHolder_h
16 
17 #include <MitkCLCoreExports.h>
18 
19 //#include <mitkBaseData.h>
20 
21 // STD Includes
22 #include <string>
23 #include <map>
24 #include <vector>
25 
26 namespace mitk
27 {
28  class MITKCLCORE_EXPORT ConfigurationHolder // : public BaseData
29  {
30  public:
31  enum ValueType
32  {
39  DT_GROUP
40  };
42 
43 
44  void SetBool(bool value);
45  void SetUnsignedInt(unsigned int value);
46  void SetInt(int value);
47  void SetDouble(double value);
48  void SetString(std::string value);
49 
50  void ClearGroup();
51  void AddToGroup(std::string id, const ConfigurationHolder &value);
52 
53  bool AsBool();
54  unsigned int AsUnsignedInt();
55  int AsInt();
56  double AsDouble();
57  std::string AsString();
58 
59  bool AsBool(bool value);
60  unsigned int AsUnsignedInt(unsigned int value);
61  int AsInt(int value);
62  double AsDouble(double value);
63  std::string AsString(std::string value);
64 
65  std::vector<std::string> AsStringVector();
66 
67  ConfigurationHolder& At(std::string id);
68 
69  private:
70  bool m_BoolValue;
71  unsigned int m_UIntValue;
72  int m_IntValue;
73  double m_DoubleValue;
74  std::string m_StringValue;
75 
76  std::map<std::string, ConfigurationHolder> m_GroupValue;
77 
78  ValueType m_ValueType;
79  };
80 }
81 
82 #endif //mitkConfigurationHolder_h
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKCLCORE_EXPORT