Medical Imaging Interaction Toolkit  2016.11.0
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 (TiXmlElement *elem) const =0
 
virtual void FromXML (TiXmlElement *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

virtual void mitk::XMLSerializable::FromXML ( TiXmlElement *  elem)
pure virtual

read your values here from elem

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

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

Definition at line 97 of file mitkXMLSerializable.cpp.

References endoAssertMsg, endodebug, and filename.

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

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

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

Definition at line 92 of file mitkXMLSerializable.cpp.

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

write your values here to elem

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

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

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

Definition at line 26 of file mitkXMLSerializable.cpp.

References endoAssertMsg.

Member Data Documentation

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.

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 files: