Medical Imaging Interaction Toolkit  2023.04.00
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 <itkObject.h>
17 #include <itkMacro.h>
18 #include <MitkCameraCalibrationExports.h>
19 
20 namespace tinyxml2
21 {
22  class XMLElement;
23 }
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(tinyxml2::XMLElement* elem) const = 0;
56  virtual void FromXML(const tinyxml2::XMLElement* 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
mitk::XMLSerializable
interface for all classes able to write themselves to XML files
Definition: mitkXMLSerializable.h:30
mitk
DataCollection - Class to facilitate loading/accessing structured data.
Definition: RenderingTests.dox:1
mitk::XMLSerializable::ROOT_NAME
static const std::string ROOT_NAME
Definition: mitkXMLSerializable.h:42
tinyxml2
Definition: mitkXMLSerializable.h:20
mitk::XMLSerializable::FILE_REFERENCE_ATTRIBUTE_NAME
static const std::string FILE_REFERENCE_ATTRIBUTE_NAME
Definition: mitkXMLSerializable.h:38