SPHinXsys  alpha version
Public Member Functions | Public Attributes | Protected Attributes | List of all members
SPH::XmlEngine Class Reference

Public Member Functions

 XmlEngine (const std::string &xml_name, const std::string &root_tag)
 
virtual ~XmlEngine ()
 
void addElementToXmlDoc (const std::string &element_name)
 
void addChildToElement (SimTK::Xml::Element &father_element, const std::string &child_name)
 
template<class T >
void setAttributeToElement (const SimTK::Xml::element_iterator &ele_ite, const std::string &attrib_name, const T &value)
 
void setAttributeToElement (const SimTK::Xml::element_iterator &ele_ite, const std::string &attrib_name, const Matd &value)
 
template<class T >
void getRequiredAttributeValue (SimTK::Xml::element_iterator &ele_ite_, const std::string &attrib_name, T &value)
 
void getRequiredAttributeMatrixValue (SimTK::Xml::element_iterator &ele_ite_, const std::string &attrib_name, Matd &value)
 
void writeToXmlFile (const std::string &filefullpath)
 
void loadXmlFile (const std::string &filefullpath)
 
std::string getRootElementTag ()
 
std::string getElementTag (SimTK::Xml::Element &element)
 
void resizeXmlDocForParticles (size_t input_size)
 
size_t SizeOfXmlDoc ()
 
SimTK::Xml::Element getChildElement (const std::string &tag)
 

Public Attributes

SimTK::Xml::Element root_element_
 

Protected Attributes

std::string xml_name_
 
SimTK::Xml::Document xmldoc_
 

Constructor & Destructor Documentation

◆ XmlEngine()

SPH::XmlEngine::XmlEngine ( const std::string &  xml_name,
const std::string &  root_tag 
)

Constructor for XML output.

◆ ~XmlEngine()

virtual SPH::XmlEngine::~XmlEngine ( )
inlinevirtual

Default destructor.

Member Function Documentation

◆ addChildToElement()

void SPH::XmlEngine::addChildToElement ( SimTK::Xml::Element &  father_element,
const std::string &  child_name 
)

Add child element to a given element.

◆ addElementToXmlDoc()

void SPH::XmlEngine::addElementToXmlDoc ( const std::string &  element_name)

Add existing element to root_element of Xml Doc.

◆ getChildElement()

SimTK::Xml::Element SPH::XmlEngine::getChildElement ( const std::string &  tag)

Get a reference to a child element

◆ getElementTag()

std::string SPH::XmlEngine::getElementTag ( SimTK::Xml::Element &  element)

Get the Tag of a element as a string

◆ getRequiredAttributeMatrixValue()

void SPH::XmlEngine::getRequiredAttributeMatrixValue ( SimTK::Xml::element_iterator &  ele_ite_,
const std::string &  attrib_name,
Matd &  value 
)

Get the required int attribute value of an element

◆ getRequiredAttributeValue()

template<class T >
void SPH::XmlEngine::getRequiredAttributeValue ( SimTK::Xml::element_iterator &  ele_ite_,
const std::string &  attrib_name,
T &  value 
)
inline

Get the required attribute value of an element

◆ getRootElementTag()

std::string SPH::XmlEngine::getRootElementTag ( )

Get the Tag of root element as a string

◆ loadXmlFile()

void SPH::XmlEngine::loadXmlFile ( const std::string &  filefullpath)

Load XML file using XML parser.

◆ resizeXmlDocForParticles()

void SPH::XmlEngine::resizeXmlDocForParticles ( size_t  input_size)

resize of Xml doc

◆ setAttributeToElement() [1/2]

template<class T >
void SPH::XmlEngine::setAttributeToElement ( const SimTK::Xml::element_iterator &  ele_ite,
const std::string &  attrib_name,
const T &  value 
)
inline

Add an attribute of type string to an xml element.

◆ setAttributeToElement() [2/2]

void SPH::XmlEngine::setAttributeToElement ( const SimTK::Xml::element_iterator &  ele_ite,
const std::string &  attrib_name,
const Matd &  value 
)

Adds attribute of type matrix to an xml element.

◆ SizeOfXmlDoc()

size_t SPH::XmlEngine::SizeOfXmlDoc ( )

Get the size of Xml doc

◆ writeToXmlFile()

void SPH::XmlEngine::writeToXmlFile ( const std::string &  filefullpath)

Write to XML file

Member Data Documentation

◆ root_element_

SimTK::Xml::Element SPH::XmlEngine::root_element_

Root element of document.

◆ xml_name_

std::string SPH::XmlEngine::xml_name_
protected

xml name.

◆ xmldoc_

SimTK::Xml::Document SPH::XmlEngine::xmldoc_
protected

the xml document.


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