Medical Imaging Interaction Toolkit  2021.02.99-89548602
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>
19 
20 namespace tinyxml2
21 {
22  class XMLElement;
23 }
24 
25 namespace mitk
26 {
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
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