Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
mitkStringProperty.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 #ifndef MITKSTRINGPROPERTY_H_HEADER_INCLUDED_C1C02491
18 #define MITKSTRINGPROPERTY_H_HEADER_INCLUDED_C1C02491
19 
20 #include <itkConfigure.h>
21 
22 #include "mitkBaseProperty.h"
23 #include <MitkCoreExports.h>
24 
25 #include <string>
26 
27 namespace mitk
28 {
29 #ifdef _MSC_VER
30 #pragma warning(push)
31 #pragma warning(disable : 4522)
32 #endif
33 
39  {
40  protected:
41  std::string m_Value;
42 
43  StringProperty(const char *string = nullptr);
44  StringProperty(const std::string &s);
45 
47 
48  public:
50  typedef std::string ValueType;
51 
52  itkFactorylessNewMacro(Self) itkCloneMacro(Self) mitkNewMacro1Param(StringProperty, const char *);
53  mitkNewMacro1Param(StringProperty, const std::string &)
54 
55  itkGetStringMacro(Value);
56  itkSetStringMacro(Value);
57 
58  virtual std::string GetValueAsString() const override;
59 
60  static const char *PATH;
61 
62  using BaseProperty::operator=;
63 
64  private:
65  // purposely not implemented
66  StringProperty &operator=(const StringProperty &);
67 
68  itk::LightObject::Pointer InternalClone() const override;
69 
70  virtual bool IsEqual(const BaseProperty &property) const override;
71  virtual bool Assign(const BaseProperty &property) override;
72  };
73 
74 #ifdef _MSC_VER
75 #pragma warning(pop)
76 #endif
77 
78 } // namespace mitk
79 
80 #endif
#define MITKCORE_EXPORT
#define mitkNewMacro1Param(classname, type)
Definition: mitkCommon.h:76
STL namespace.
DataCollection - Class to facilitate loading/accessing structured data.
Abstract base class for properties.
#define mitkClassMacro(className, SuperClassName)
Definition: mitkCommon.h:44
Property for strings.