Particle Identification and Tracking
Public Member Functions | Private Attributes | List of all members
utilities::Read_config Class Reference

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 >
get_value (const std::string &attr_name, T &val) const
 looks up the value of the given attribute. More...
 
template<class 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_storeget_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...
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

Parameters
fnamethe xml file to parse
elm_namethe element to look for the parameters in.

References utilities::Md_store::add_element(), and md_store_.

Read_config::~Read_config ( )

destructor

Member Function Documentation

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().

std::string utilities::Read_config::get_key ( int  j) const
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_.

const Md_store* utilities::Read_config::get_store ( ) const
inline

Returns a pointer to the internal Md_store.

References md_store_.

Referenced by main().

utilities::V_TYPE utilities::Read_config::get_type ( int  j) const
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().

template<class T >
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.

Parameters
[in]attr_nameattribute name
[out]valthe 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().

template<class T >
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().

int utilities::Read_config::size ( ) const
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().

Member Data Documentation

Md_store utilities::Read_config::md_store_
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().


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