#include <ServiceLocatedObject.h>
Public Member Functions | |
int | AddChild (XMLTag *child, int position=-1) |
void | AddProperty (const std::string &name, const std::string &value) |
void | AddProperty (const std::string &name, const unsigned long &value) |
void | AddProperty (const std::string &name, const int &value) |
void | AddProperty (const std::string &name, const double &value) |
XMLTag * | Clone () const |
unsigned int | CountChildren () const |
unsigned long | date () |
double | GetCDataDouble () const |
int | GetCDataInt () const |
std::string | GetCDataST () const |
XMLTag * | GetChild (const unsigned int &position) |
XMLTag * | GetChild (const std::string &name) |
XMLTag * | GetChild (const std::string &name, int innerindex) |
std::string & | GetName () |
std::string | GetProperty (const std::string &name) |
double | GetPropertyDouble (const std::string &name) |
int | GetPropertyInt (const std::string &name) |
void | RemoveChild (const unsigned int &position) |
void | RemoveChild (const std::string &name) |
void | ReplaceChild (XMLTag *child, int position) |
void | SetCData (const int &value) |
void | SetCData (const double &value) |
void | SetCData (const std::string &value) |
virtual void | Write (xmlTextWriter *pWriter) const |
void | WriteToFile (const std::string &stFile, XMLTag **fileReference=NULL) const |
char * | WriteToString () const |
XMLTag (std::string Name) | |
virtual | ~XMLTag () |
Static Public Member Functions | |
template<typename T > | |
static T | Load (XMLTag *tag, T *t) |
template<typename T > | |
static std::vector< T > | Load (XMLTag *tag, std::vector< T > *) |
template<typename T1 , typename T2 > | |
static std::pair< T1, T2 > | Load (XMLTag *tag, std::pair< T1, T2 > *) |
static int | Load (XMLTag *tag, int *) |
static double | Load (XMLTag *tag, double *) |
static std::string | Load (XMLTag *tag, std::string *) |
static Matrix | Load (XMLTag *tag, Matrix *) |
static unsigned int | OldTag () |
static XMLTag * | Read (xmlTextReader *pReader) |
static XMLTag * | ReadFromFile (const std::string &stFile) |
template<typename T > | |
static XMLTag * | Tag (std::vector< T > vector, std::string name="") |
template<typename T1 , typename T2 > | |
static XMLTag * | Tag (std::pair< T1, T2 > p, std::string name="") |
static XMLTag * | Tag (int n, std::string name="") |
static XMLTag * | Tag (double d, std::string name="") |
static XMLTag * | Tag (std::string value, std::string name="") |
static XMLTag * | Tag (const Matrix &alg, std::string name="") |
Private Member Functions | |
void | Touch () |
Private Attributes | |
std::string | m_cData |
std::vector< XMLTag * > | m_children |
unsigned long | m_lastChanged |
std::string | m_name |
std::map< std::string, std::string > | m_properties |
Definition at line 74 of file ServiceLocatedObject.h.
XMLTag::XMLTag | ( | std::string | Name | ) |
Constructor, sets the tag name
Definition at line 56 of file ServiceInterface.cpp.
XMLTag::~XMLTag | ( | ) | [virtual] |
Empty Destructor
Definition at line 122 of file ServiceInterface.cpp.
int XMLTag::AddChild | ( | XMLTag * | child, |
int | position = -1 |
||
) |
AddChild: adds a child node to a tag
Adds a child node to a tag, the position where to put it can be influenced if the position is larger or smaller than the possible range the element will be put at the end of the list.
child | pointer to an existing tag, a null child will not be appended |
position | position where to put the cild in the child list |
final | position that was selected, or -1 |
Definition at line 366 of file ServiceInterface.cpp.
void XMLTag::AddProperty | ( | const std::string & | name, |
const std::string & | value | ||
) |
AddProperty: adds a property as an attribute to the current tag
adds a property as an attribute to the current tag
name | name of the property, works as a key |
value | value of the property |
Definition at line 277 of file ServiceInterface.cpp.
void XMLTag::AddProperty | ( | const std::string & | name, |
const unsigned long & | value | ||
) |
Definition at line 284 of file ServiceInterface.cpp.
void XMLTag::AddProperty | ( | const std::string & | name, |
const int & | value | ||
) |
Definition at line 293 of file ServiceInterface.cpp.
void XMLTag::AddProperty | ( | const std::string & | name, |
const double & | value | ||
) |
Definition at line 302 of file ServiceInterface.cpp.
XMLTag * XMLTag::Clone | ( | ) | const |
Clone: clones the current tag and returns it
clone includes recursive copying of all children
Definition at line 219 of file ServiceInterface.cpp.
unsigned int XMLTag::CountChildren | ( | ) | const |
CountChildren: counts the childdren-tags of the current tag
Counts the children
number | of children |
Definition at line 395 of file ServiceInterface.cpp.
unsigned long XMLTag::date | ( | ) |
Definition at line 473 of file ServiceInterface.cpp.
double XMLTag::GetCDataDouble | ( | ) | const |
Definition at line 322 of file ServiceInterface.cpp.
int XMLTag::GetCDataInt | ( | ) | const |
GetCData*: returns the current content
returns the current content
the | content or empty("", 0, 0.0) |
Definition at line 318 of file ServiceInterface.cpp.
std::string XMLTag::GetCDataST | ( | ) | const |
Definition at line 326 of file ServiceInterface.cpp.
XMLTag * XMLTag::GetChild | ( | const unsigned int & | position | ) |
GetChild: returns a child tag
returns a child tag
position/name | descriptor for the child |
a | child tag |
Definition at line 424 of file ServiceInterface.cpp.
XMLTag * XMLTag::GetChild | ( | const std::string & | name | ) |
Definition at line 440 of file ServiceInterface.cpp.
XMLTag * XMLTag::GetChild | ( | const std::string & | name, |
int | innerindex | ||
) |
Definition at line 455 of file ServiceInterface.cpp.
std::string& jlo::XMLTag::GetName | ( | ) | [inline] |
GetName: returns the name of a tag
The name of the tag (<name></name>)
Definition at line 476 of file ServiceLocatedObject.h.
std::string XMLTag::GetProperty | ( | const std::string & | name | ) |
GetProperty*: returns the value of a property
Returns the current value of a property
name | name of the property |
the | value or empty ("", 0, 0.0) |
Definition at line 345 of file ServiceInterface.cpp.
double XMLTag::GetPropertyDouble | ( | const std::string & | name | ) |
Definition at line 352 of file ServiceInterface.cpp.
int XMLTag::GetPropertyInt | ( | const std::string & | name | ) |
Definition at line 359 of file ServiceInterface.cpp.
static T jlo::XMLTag::Load | ( | XMLTag * | tag, |
T * | t | ||
) | [inline, static] |
Load: Load a Type T from a XMLTag
Supported Types are for example: vector, pair, double, int, string, Matrix
tag | the tag that was read from a file or created with a Tag function |
T* | a pointer that specifies the wished class (necessary for resolving the template) |
char* | with an error message in case of failure |
Definition at line 249 of file ServiceLocatedObject.h.
static std::vector<T> jlo::XMLTag::Load | ( | XMLTag * | tag, |
std::vector< T > * | |||
) | [inline, static] |
Definition at line 255 of file ServiceLocatedObject.h.
static std::pair<T1, T2> jlo::XMLTag::Load | ( | XMLTag * | tag, |
std::pair< T1, T2 > * | |||
) | [inline, static] |
Definition at line 274 of file ServiceLocatedObject.h.
static int jlo::XMLTag::Load | ( | XMLTag * | tag, |
int * | |||
) | [inline, static] |
Definition at line 286 of file ServiceLocatedObject.h.
static double jlo::XMLTag::Load | ( | XMLTag * | tag, |
double * | |||
) | [inline, static] |
Definition at line 293 of file ServiceLocatedObject.h.
static std::string jlo::XMLTag::Load | ( | XMLTag * | tag, |
std::string * | |||
) | [inline, static] |
Definition at line 300 of file ServiceLocatedObject.h.
Matrix XMLTag::Load | ( | XMLTag * | tag, |
Matrix * | |||
) | [static] |
Definition at line 101 of file ServiceInterface.cpp.
static unsigned int jlo::XMLTag::OldTag | ( | ) | [inline, static] |
Definition at line 479 of file ServiceLocatedObject.h.
XMLTag * XMLTag::Read | ( | xmlTextReader * | pReader | ) | [static] |
Read: Reads an XMLTag from a readeer
Supporting function for ReadFromFile
pReader | pointer to an libxml2 xmlTextReader |
Definition at line 233 of file ServiceInterface.cpp.
XMLTag * XMLTag::ReadFromFile | ( | const std::string & | stFile | ) | [static] |
ReadFromFile: Creates a new XMLTag from a file
As constructor this would have had the same function signature as the std. constructor so its a static function
stFile | absolut filename |
Definition at line 200 of file ServiceInterface.cpp.
void XMLTag::RemoveChild | ( | const unsigned int & | position | ) |
RemoveChild: removes an XMLTag* from the list
Adds a child node to a tag, the position where to put it can be influenced if the position is larger or smaller than the possible range the element will be put at the end of the list.
position | position where to erase a cild |
Definition at line 400 of file ServiceInterface.cpp.
void XMLTag::RemoveChild | ( | const std::string & | name | ) |
Definition at line 409 of file ServiceInterface.cpp.
void XMLTag::ReplaceChild | ( | XMLTag * | child, |
int | position | ||
) |
Definition at line 380 of file ServiceInterface.cpp.
void XMLTag::SetCData | ( | const int & | value | ) |
SetCData: sets the current content of the tag
sets the current content of a tag
value | content of the tag |
Definition at line 331 of file ServiceInterface.cpp.
void XMLTag::SetCData | ( | const double & | value | ) |
Definition at line 310 of file ServiceInterface.cpp.
void XMLTag::SetCData | ( | const std::string & | value | ) |
Definition at line 339 of file ServiceInterface.cpp.
static XMLTag* jlo::XMLTag::Tag | ( | std::vector< T > | vector, |
std::string | name = "" |
||
) | [inline, static] |
Tag: creates XMLTags from standard types, like vector pair, int, double, Elem
T | contains the element that should be saved in the tag |
name | defines the name of the node, there are standard names for every implemented tag |
Definition at line 202 of file ServiceLocatedObject.h.
static XMLTag* jlo::XMLTag::Tag | ( | std::pair< T1, T2 > | p, |
std::string | name = "" |
||
) | [inline, static] |
Definition at line 219 of file ServiceLocatedObject.h.
XMLTag * XMLTag::Tag | ( | int | n, |
std::string | name = "" |
||
) | [static] |
Definition at line 62 of file ServiceInterface.cpp.
XMLTag * XMLTag::Tag | ( | double | d, |
std::string | name = "" |
||
) | [static] |
Definition at line 69 of file ServiceInterface.cpp.
XMLTag * XMLTag::Tag | ( | std::string | value, |
std::string | name = "" |
||
) | [static] |
Definition at line 76 of file ServiceInterface.cpp.
XMLTag * XMLTag::Tag | ( | const Matrix & | alg, |
std::string | name = "" |
||
) | [static] |
Definition at line 84 of file ServiceInterface.cpp.
void XMLTag::Touch | ( | ) | [private] |
finction to reset the timestamp
Definition at line 478 of file ServiceInterface.cpp.
void XMLTag::Write | ( | xmlTextWriter * | pWriter | ) | const [virtual] |
Write: helping function for WriteToFile
Writes an XMLTag to an File,
pWriter | pointer to the xmlWriter |
Definition at line 180 of file ServiceInterface.cpp.
void XMLTag::WriteToFile | ( | const std::string & | stFile, |
XMLTag ** | fileReference = NULL |
||
) | const |
Methods WriteToFile: Writes an XMLTag to an File
Writes an XMLTag to an File, can return a XMLTag* that refers the file. Such a file reference will be resolved when it is a child of another node and GetChild is called
stFile | absolut filename |
fileReference a pointer that receives the pointer to the new file reference tag
error | code |
Definition at line 138 of file ServiceInterface.cpp.
char * XMLTag::WriteToString | ( | ) | const |
SetCData: sets the current content of the tag
sets the current content of a tag
value | content of the tag |
Definition at line 161 of file ServiceInterface.cpp.
std::string jlo::XMLTag::m_cData [private] |
Definition at line 497 of file ServiceLocatedObject.h.
std::vector<XMLTag*> jlo::XMLTag::m_children [private] |
Definition at line 496 of file ServiceLocatedObject.h.
unsigned long jlo::XMLTag::m_lastChanged [private] |
Definition at line 495 of file ServiceLocatedObject.h.
std::string jlo::XMLTag::m_name [private] |
Definition at line 498 of file ServiceLocatedObject.h.
std::map<std::string, std::string> jlo::XMLTag::m_properties [private] |
Definition at line 499 of file ServiceLocatedObject.h.