MaMiCo 1.2
Loading...
Searching...
No Matches
tarch::configuration::ParseConfiguration Class Reference

#include <ParseConfiguration.h>

Classes

class  XMLConfiguration
 

Static Public Member Functions

template<class Configuration>
static void parseConfiguration (const std::string filename, const std::string topleveltag, Configuration &config)
 
static void readDoubleMandatory (double &storage, tinyxml2::XMLElement *node, std::string tag)
 
static void readDoubleOptional (double &storage, tinyxml2::XMLElement *node, std::string tag)
 
static void readIntMandatory (int &storage, tinyxml2::XMLElement *node, std::string tag)
 
static void readIntOptional (int &storage, tinyxml2::XMLElement *node, std::string tag)
 
static void readBoolMandatory (bool &storage, tinyxml2::XMLElement *node, std::string tag)
 
static void readBoolOptional (bool &storage, tinyxml2::XMLElement *node, std::string tag)
 
static void readStringMandatory (std::string &storage, tinyxml2::XMLElement *node, std::string tag)
 
static void readStringOptional (std::string &storage, tinyxml2::XMLElement *node, std::string tag)
 
template<unsigned int size, class T>
static void readVector (tarch::la::Vector< size, T > &result, const char *myText)
 
template<unsigned int size, class T>
static void readVectorMandatory (tarch::la::Vector< size, T > &result, tinyxml2::XMLElement *node, std::string tag)
 
template<unsigned int size, class T>
static void readVectorOptional (tarch::la::Vector< size, T > &result, tinyxml2::XMLElement *node, std::string tag)
 

Detailed Description

interface for configuration using tinyxml2

Author
Philipp Neumann

Member Function Documentation

◆ parseConfiguration()

template<class Configuration>
static void tarch::configuration::ParseConfiguration::parseConfiguration ( const std::string filename,
const std::string topleveltag,
Configuration & config )
inlinestatic

parses an xml configuration file, and stores the information in the object config

Template Parameters
Configuration

◆ readBoolMandatory()

static void tarch::configuration::ParseConfiguration::readBoolMandatory ( bool & storage,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads a bool value at node "node" with tag "tag" and stores the result in "storage". the program is exited if the value cannot be read.

Parameters
storage
node
tag

◆ readBoolOptional()

static void tarch::configuration::ParseConfiguration::readBoolOptional ( bool & storage,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads a bool value at node "node" with tag "tag" and stores the result in "storage". the program continues and only stores the result in "storage" if "tag" is existent

Parameters
storage
node
tag

◆ readDoubleMandatory()

static void tarch::configuration::ParseConfiguration::readDoubleMandatory ( double & storage,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads a double value at node "node" with tag "tag" and stores the result in "storage". the program is exited if the value cannot be read.

Parameters
storage
node
tag

◆ readDoubleOptional()

static void tarch::configuration::ParseConfiguration::readDoubleOptional ( double & storage,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads a double value at node "node" with tag "tag" and stores the result in "storage". the program continues and only stores the result in "storage" if "tag" is existent

Parameters
storage
node
tag

◆ readIntMandatory()

static void tarch::configuration::ParseConfiguration::readIntMandatory ( int & storage,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads a int value at node "node" with tag "tag" and stores the result in "storage". the program is exited if the value cannot be read.

Parameters
storage
node
tag

◆ readIntOptional()

static void tarch::configuration::ParseConfiguration::readIntOptional ( int & storage,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads a int value at node "node" with tag "tag" and stores the result in "storage". the program continues and only stores the result in "storage" if "tag" is existent

Parameters
storage
node
tag

◆ readStringMandatory()

static void tarch::configuration::ParseConfiguration::readStringMandatory ( std::string & storage,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads a string value at node "node" with tag "tag" and stores the result in "storage". the program is exited if the value cannot be read.

Parameters
storage
node
tag

◆ readStringOptional()

static void tarch::configuration::ParseConfiguration::readStringOptional ( std::string & storage,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads a string value at node "node" with tag "tag" and stores the result in "storage". the program continues and only stores the result in "storage" if "tag" is existent

Parameters
storage
node
tag

◆ readVector()

template<unsigned int size, class T>
static void tarch::configuration::ParseConfiguration::readVector ( tarch::la::Vector< size, T > & result,
const char * myText )
inlinestatic

reads with ";"-separated entry "tag" with "size" entries and returns the corresponding vector on success

Template Parameters
TData type
Sizesize of the entry
Parameters
result
myText

◆ readVectorMandatory()

template<unsigned int size, class T>
static void tarch::configuration::ParseConfiguration::readVectorMandatory ( tarch::la::Vector< size, T > & result,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads with ";"-separated entry "tag" with "size" entries and returns the corresponding vector on success

Template Parameters
TData type
Sizesize of the entry
Parameters
result
node
tag

◆ readVectorOptional()

template<unsigned int size, class T>
static void tarch::configuration::ParseConfiguration::readVectorOptional ( tarch::la::Vector< size, T > & result,
tinyxml2::XMLElement * node,
std::string tag )
inlinestatic

reads with ";"-separated entry "tag" with "size" entries and returns the corresponding vector on success if "tag" is existent

Template Parameters
TData type
Sizesize of the entry
Parameters
result
node
tag

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