|
Particle Identification and Tracking
|
class for reading configuration from xml files. More...
#include <read_config.h>
Collaboration diagram for utilities::Read_config:Public Member Functions | |
| Read_config (std::string fname, std::string elm_name) | |
| constructor. More... | |
| ~Read_config () | |
| destructor More... | |
| template<class T > | |
| T | get_value (const std::string &attr_name, T &val) const |
| looks up the value of the given attribute. More... | |
| template<class T > | |
| T | get_value (int j, T &val) const |
| Gets value at index j. More... | |
| bool | contains_key (const std::string &key) const |
| Returns true if the stanza contains a pram with the given key. More... | |
| int | get_key_index (const std::string &key) const |
| Returns the index of the given key in the internal structure. More... | |
| void | print () const |
| prints all information stored. More... | |
| int | size () const |
| Returns the number of parsed prams. More... | |
| std::string | get_key (int j) const |
| Returns the key at j in the internal structure. More... | |
| utilities::V_TYPE | get_type (int j) const |
| Returns the type at j in the internal structure. More... | |
| const Md_store * | get_store () const |
| Returns a pointer to the internal Md_store. More... | |
Private Attributes | |
| Md_store | md_store_ |
| The object that actually handles all of the meta data storage and querying. More... | |
class for reading configuration from xml files.
This is very simple. Each instance can only read from one element in the xml file and the element must be a child of the root. This may be better done as a factory to make Md_store objects as all of the functions are implemented by just passing to the Md_store object.
| Read_config::Read_config | ( | std::string | fname, |
| std::string | elm_name | ||
| ) |
constructor.
The vector of strings is the list of attributes to try to parse.
| fname | the xml file to parse |
| elm_name | the element to look for the parameters in. |
References utilities::Md_store::add_element(), and md_store_.
| Read_config::~Read_config | ( | ) |
destructor
| bool Read_config::contains_key | ( | const std::string & | key) | const |
Returns true if the stanza contains a pram with the given key.
References utilities::Md_store::contains_key(), and md_store_.
Referenced by main().
|
inline |
Returns the key at j in the internal structure.
References utilities::Md_store::get_key(), and md_store_.
Referenced by utilities::Wrapper_o_hdf::add_meta_data_list().
| int Read_config::get_key_index | ( | const std::string & | key) | const |
Returns the index of the given key in the internal structure.
References utilities::Md_store::get_key_index(), and md_store_.
|
inline |
|
inline |
Returns the type at j in the internal structure.
References utilities::Md_store::get_type(), and md_store_.
Referenced by utilities::Wrapper_o_hdf::add_meta_data_list().
| T Read_config::get_value | ( | const std::string & | attr_name, |
| T & | val | ||
| ) | const |
looks up the value of the given attribute.
The value is returned by reference. The function returns the value.
| [in] | attr_name | attribute name |
| [out] | val | the value |
References utilities::Md_store::get_key_index(), utilities::Md_store::get_value(), and md_store_.
Referenced by utilities::Wrapper_o_hdf::add_meta_data_list(), and main().
| T Read_config::get_value | ( | int | j, |
| T & | val | ||
| ) | const |
Gets value at index j.
The value is returned by reference. The function returns as well the value.
References utilities::Md_store::get_value(), and md_store_.
| void Read_config::print | ( | ) | const |
prints all information stored.
References md_store_, and utilities::Md_store::print().
Referenced by main().
|
inline |
Returns the number of parsed prams.
References md_store_, and utilities::Md_store::size().
Referenced by utilities::Wrapper_o_hdf::add_meta_data_list().
|
private |
The object that actually handles all of the meta data storage and querying.
Referenced by contains_key(), get_key(), get_key_index(), get_store(), get_type(), get_value(), print(), Read_config(), and size().
1.8.4