Medical Imaging Interaction Toolkit  2018.4.99-f51274ea
Medical Imaging Interaction Toolkit
mitkXMLSerializable.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 #ifndef MITKXMLSerializable_H
13 #define MITKXMLSerializable_H
14 
15 #include <string>
16 #include <tinyxml.h>
17 #include <itkObject.h>
18 #include <itkMacro.h>
20 
21 namespace mitk
22 {
27  {
28  public:
34  static const std::string FILE_REFERENCE_ATTRIBUTE_NAME;
38  static const std::string ROOT_NAME;
43  virtual const char* GetNameOfClass() const = 0;
44 
48  virtual void ToXML(TiXmlElement* elem) const = 0;
52  virtual void FromXML(TiXmlElement* elem) = 0;
53 
57  virtual void ToXMLFile(const std::string& file
58  , const std::string& elemName="");
59 
72  virtual void FromXMLFile(const std::string& file
73  , const std::string& elemName="");
74 
78  std::string GetXMLFileName() const;
79 
80  private:
84  std::string m_XMLFileName;
85  };
86 }
87 
88 #endif
DataCollection - Class to facilitate loading/accessing structured data.
static const std::string ROOT_NAME
#define MITKCAMERACALIBRATION_EXPORT
static const std::string FILE_REFERENCE_ATTRIBUTE_NAME
interface for all classes able to write themselves to XML files