Medical Imaging Interaction Toolkit  2023.12.00
Medical Imaging Interaction Toolkit
mitk::XMLSerializable Class Referenceabstract

interface for all classes able to write themselves to XML files More...

#include <mitkXMLSerializable.h>

Inheritance diagram for mitk::XMLSerializable:
Collaboration diagram for mitk::XMLSerializable:

Public Member Functions

virtual const char * GetNameOfClass () const =0
 
virtual void ToXML (tinyxml2::XMLElement *elem) const =0
 
virtual void FromXML (const tinyxml2::XMLElement *elem)=0
 
virtual void ToXMLFile (const std::string &file, const std::string &elemName="")
 
virtual void FromXMLFile (const std::string &file, const std::string &elemName="")
 
std::string GetXMLFileName () const
 

Static Public Attributes

static const std::string FILE_REFERENCE_ATTRIBUTE_NAME
 
static const std::string ROOT_NAME
 

Detailed Description

interface for all classes able to write themselves to XML files

Definition at line 30 of file mitkXMLSerializable.h.

Member Function Documentation

◆ FromXML()

virtual void mitk::XMLSerializable::FromXML ( const tinyxml2::XMLElement *  elem)
pure virtual

read your values here from elem

Implemented in mitk::Transform, and mitk::CameraIntrinsics.

◆ FromXMLFile()

virtual void mitk::XMLSerializable::FromXMLFile ( const std::string &  file,
const std::string &  elemName = "" 
)
virtual

loads the XML file and calls FromXML() takes the first child of the document if this root node value is not equal to GetNameOfClass() the method will try to find the first children of the root node with the value of GetNameOfClass() if elemName is not empty then this value will be used instead of GetNameOfClass() if this node is found it will check if an attribute named FILE_REFERENCE_ATTRIBUTE_NAME is found: in this case the method calls itself with this attributes value as parameter

◆ GetNameOfClass()

virtual const char* mitk::XMLSerializable::GetNameOfClass ( ) const
pure virtual

the tag value will be equals to the class name (function implemented by the itkTypeMacro)

◆ GetXMLFileName()

std::string mitk::XMLSerializable::GetXMLFileName ( ) const
See also
m_XMLFileName

◆ ToXML()

virtual void mitk::XMLSerializable::ToXML ( tinyxml2::XMLElement *  elem) const
pure virtual

write your values here to elem

Implemented in mitk::Transform, and mitk::CameraIntrinsics.

◆ ToXMLFile()

virtual void mitk::XMLSerializable::ToXMLFile ( const std::string &  file,
const std::string &  elemName = "" 
)
virtual

tries to write the xml data obtained in ToXML() to file

Member Data Documentation

◆ FILE_REFERENCE_ATTRIBUTE_NAME

const std::string mitk::XMLSerializable::FILE_REFERENCE_ATTRIBUTE_NAME
static

value of the special tag for file references if this is attribute is found the class will be loaded from the file in the attributes value

Definition at line 38 of file mitkXMLSerializable.h.

◆ ROOT_NAME

const std::string mitk::XMLSerializable::ROOT_NAME
static

the name of the root node that is created when the element is saved

Definition at line 42 of file mitkXMLSerializable.h.


The documentation for this class was generated from the following file: