ls1-MarDyn
ls1-MarDyn molecular dynamics code
Classes | Public Member Functions | Friends | List of all members
XMLfile::Query Class Reference

Classes

class  const_iterator
 

Public Member Functions

 Query ()
 XMLfile::Query constructor sets up an invalid query.
 
 Query (const Query &q)
 copy constructor duplicate a given query and register the new created one at the XMLfile More...
 
 ~Query ()
 XMLfile::Query destructor unregister the query.
 
unsigned long card () const
 get cardinality of query set return the size of the query set More...
 
bool empty () const
 check ,if query set is empty return true if the query set is empty More...
 
void invalidate ()
 invalidate query unregister from XMLfile and invalidate the query
 
Node front () const
 get first query entry return the first Node of the query set (invalid Node, if there's none) More...
 
Queryoperator= (const Query &q)
 assignment operator copy/duplicate other query content to query More...
 
 operator unsigned long () const
 unsigned long cast operator return cardinality
 
 operator bool () const
 bool cast operator return if query is valid
 
Node operator[] (unsigned long idx) const
 indexing operator return the Node within the query at given index, or empty node, if query or index is invalid More...
 
const_iterator begin () const
 get starting iterator return an iterator to the first node More...
 
const_iterator rbegin () const
 get reverse starting iterator return an iterator to the last node More...
 
bool end () const
 get (dummy) iteration end for comparison return false (as dummy) to enable e.g. for(it=query.begin();it!=query.end();++it) this is preferable to just use e.g. for(it=query.begin();it;++it) More...
 
template<typename T >
unsigned long getNodeValue (T &value) const
 get node value get the node content and convert it to a given type More...
 
std::string getNodeValue_string (const std::string defaultvalue=std::string()) const
 get node value as string get the node content More...
 
int getNodeValue_int (int defaultvalue=0) const
 get node value as int get the node content and convert it to an int More...
 
long getNodeValue_long (long defaultvalue=0) const
 get node value as long get the node content and convert it to a long More...
 
float getNodeValue_float (float defaultvalue=0.) const
 get node value as float get the node content and convert it to a float More...
 
double getNodeValue_double (double defaultvalue=0.) const
 get node value as double get the node content and convert it to a double More...
 
bool getNodeValue_bool (bool defaultvalue=false) const
 get node value as bool get the node content and convert it to a bool More...
 
void printXML (std::ostream &ostrm=std::cout) const
 print XML data to stream print the query content using XML syntax More...
 
void print (std::ostream &ostrm=std::cout) const
 print data to stream print the query content More...
 

Friends

class XMLfile
 

Constructor & Destructor Documentation

◆ Query()

XMLfile::Query::Query ( const Query q)
inline

copy constructor duplicate a given query and register the new created one at the XMLfile

Parameters
constQuery& query

Member Function Documentation

◆ begin()

const_iterator XMLfile::Query::begin ( ) const
inline

get starting iterator return an iterator to the first node

Returns
XMLfile::Query::const_iterator iterator

◆ card()

unsigned long XMLfile::Query::card ( ) const
inline

get cardinality of query set return the size of the query set

Returns
unsigned long cardinality

◆ empty()

bool XMLfile::Query::empty ( ) const
inline

check ,if query set is empty return true if the query set is empty

Returns
bool is empty?

◆ end()

bool XMLfile::Query::end ( ) const
inline

get (dummy) iteration end for comparison return false (as dummy) to enable e.g. for(it=query.begin();it!=query.end();++it) this is preferable to just use e.g. for(it=query.begin();it;++it)

Returns
boolean false

◆ front()

Node XMLfile::Query::front ( ) const
inline

get first query entry return the first Node of the query set (invalid Node, if there's none)

Returns
XMLfile::Node first Node

◆ getNodeValue()

template<typename T >
template unsigned long XMLfile::Query::getNodeValue ( T &  value) const

get node value get the node content and convert it to a given type

Parameters
T&variable to return value
Returns
unsigned long number of nodes matching the nodepath

◆ getNodeValue_bool()

bool XMLfile::Query::getNodeValue_bool ( bool  defaultvalue = false) const
inline

get node value as bool get the node content and convert it to a bool

Parameters
booldefault value to return, if node is not found
Returns
bool node value

◆ getNodeValue_double()

double XMLfile::Query::getNodeValue_double ( double  defaultvalue = 0.) const
inline

get node value as double get the node content and convert it to a double

Parameters
doubledefault value to return, if node is not found
Returns
double node value

◆ getNodeValue_float()

float XMLfile::Query::getNodeValue_float ( float  defaultvalue = 0.) const
inline

get node value as float get the node content and convert it to a float

Parameters
floatdefault value to return, if node is not found
Returns
float node value

◆ getNodeValue_int()

int XMLfile::Query::getNodeValue_int ( int  defaultvalue = 0) const
inline

get node value as int get the node content and convert it to an int

Parameters
intdefault value to return, if node is not found
Returns
int node value

◆ getNodeValue_long()

long XMLfile::Query::getNodeValue_long ( long  defaultvalue = 0) const
inline

get node value as long get the node content and convert it to a long

Parameters
longdefault value to return, if node is not found
Returns
long node value

◆ getNodeValue_string()

std::string XMLfile::Query::getNodeValue_string ( const std::string  defaultvalue = std::string()) const
inline

get node value as string get the node content

Parameters
conststd::string default value to return, if node is not found
Returns
std::string node value

◆ operator=()

XMLfile::Query & XMLfile::Query::operator= ( const Query q)

assignment operator copy/duplicate other query content to query

Parameters
constQuery& source query
Returns
XMLfile::Query reference to this query

◆ operator[]()

Node XMLfile::Query::operator[] ( unsigned long  idx) const
inline

indexing operator return the Node within the query at given index, or empty node, if query or index is invalid

Parameters
unsignedlong index
Returns
XMLfile::Node node

◆ print()

void XMLfile::Query::print ( std::ostream &  ostrm = std::cout) const

print data to stream print the query content

Parameters
std::ostream&stream to write to (default: std::cout)

◆ printXML()

void XMLfile::Query::printXML ( std::ostream &  ostrm = std::cout) const

print XML data to stream print the query content using XML syntax

Parameters
std::ostream&stream to write to (default: std::cout)

◆ rbegin()

const_iterator XMLfile::Query::rbegin ( ) const
inline

get reverse starting iterator return an iterator to the last node

Returns
XMLfile::Query::const_iterator iterator

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