Medical Imaging Interaction Toolkit  2016.11.0
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 
18 #ifndef mitkConfigurationHolder_h
19 #define mitkConfigurationHolder_h
20 
21 #include <MitkCLCoreExports.h>
22 
23 //#include <mitkBaseData.h>
24 
25 // STD Includes
26 #include <string>
27 #include <map>
28 #include <vector>
29 
30 namespace mitk
31 {
32  class MITKCLCORE_EXPORT ConfigurationHolder // : public BaseData
33  {
34  public:
35  enum ValueType
36  {
43  DT_GROUP
44  };
46 
47 
48  void SetBool(bool value);
49  void SetUnsignedInt(unsigned int value);
50  void SetInt(int value);
51  void SetDouble(double value);
52  void SetString(std::string value);
53 
54  void ClearGroup();
55  void AddToGroup(std::string id, const ConfigurationHolder &value);
56 
57  bool AsBool();
58  unsigned int AsUnsignedInt();
59  int AsInt();
60  double AsDouble();
61  std::string AsString();
62 
63  bool AsBool(bool value);
64  unsigned int AsUnsignedInt(unsigned int value);
65  int AsInt(int value);
66  double AsDouble(double value);
67  std::string AsString(std::string value);
68 
69  std::vector<std::string> AsStringVector();
70 
71  ConfigurationHolder& At(std::string id);
72 
73  private:
74 // this pragma ignores the following warning:
75 // warning C4251: 'mitk::Particle::pos' : class 'ATL::CStringT' needs to have dll-interface to be used by clients of class 'Particle'
76 #ifdef _MSC_VER
77  #pragma warning(push)
78  #pragma warning(disable: 4251)
79 #endif
80 
81  bool m_BoolValue;
82  unsigned int m_UIntValue;
83  int m_IntValue;
84  double m_DoubleValue;
85  std::string m_StringValue;
86 
87  std::map<std::string, ConfigurationHolder> m_GroupValue;
88 
89  ValueType m_ValueType;
90 
91 #ifdef _MSC_VER
92  #pragma warning(pop)
93 #endif
94  };
95 }
96 
97 #endif //mitkConfigurationHolder_h
DataCollection - Class to facilitate loading/accessing structured data.
#define MITKCLCORE_EXPORT
ValueType
Type of the value held by a Value object.
Definition: jsoncpp.h:345