Medical Imaging Interaction Toolkit  2016.11.0
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,
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 #ifndef MITKXMLSerializable_H
17 #define MITKXMLSerializable_H
18 
19 #include <string>
20 #include <tinyxml.h>
21 #include <itkObject.h>
22 #include <itkMacro.h>
23 #include <MitkCameraCalibrationExports.h>
24 
25 namespace mitk
26 {
30  class MITKCAMERACALIBRATION_EXPORT XMLSerializable
31  {
32  public:
38  static const std::string FILE_REFERENCE_ATTRIBUTE_NAME;
42  static const std::string ROOT_NAME;
47  virtual const char* GetNameOfClass() const = 0;
48 
52  virtual void ToXML(TiXmlElement* elem) const = 0;
56  virtual void FromXML(TiXmlElement* elem) = 0;
57 
61  virtual void ToXMLFile(const std::string& file
62  , const std::string& elemName="");
63 
76  virtual void FromXMLFile(const std::string& file
77  , const std::string& elemName="");
78 
82  std::string GetXMLFileName() const;
83 
84  private:
88  std::string m_XMLFileName;
89  };
90 }
91 
92 #endif
DataCollection - Class to facilitate loading/accessing structured data.
static const std::string ROOT_NAME
static const std::string FILE_REFERENCE_ATTRIBUTE_NAME
interface for all classes able to write themselves to XML files