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

A class to hold meta data. More...

#include <md_store.h>

+ Collaboration diagram for utilities::Md_store:

Classes

struct  Md_element
 A struct to store meta data information, (key,type,val) as strings to make passing this stuff around easy. More...
 

Public Member Functions

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 >
void set_value (const std::string &attr_name, const T &val, bool over_write=true)
 Sets a given (key,val) pair. More...
 
float get_value (int j, float &val) const
 Returns value at index j. More...
 
int get_value (int j, int &val) const
 Gets value at index j. More...
 
unsigned int get_value (int j, unsigned int &val) const
 Gets value at index j. More...
 
std::string get_value (int j, std::string &val) const
 Gets value at index j. More...
 
bool get_value (int j, bool &val) const
 Gets value at index j. More...
 
bool remove_key (const std::string &key)
 removes a given key More...
 
bool contains_key (const std::string &key) const
 Returns true if the stanza contains a pram with the given key. More...
 
bool contains_key (const std::string &key, unsigned int &indx) 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...
 
unsigned 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...
 
void * get_val (int j) const
 Returns the value as a (void *) More...
 
void add_elements (const Md_store *md_in)
 Add all elements in md_in to this Md_store object. More...
 
void print () const
 Print out the contents. More...
 
 ~Md_store ()
 Destructor. More...
 
 Md_store ()
 Default constructor. More...
 
 Md_store (const utilities::Attr_list_hdf &)
 Constructor from an attr_list. More...
 
void add_element (const std::string &key, const std::string &type, const std::string &value)
 Don't use these, will became private. More...
 
void add_element (const char *key, const char *type, const char *value)
 Don't use these, will became private. More...
 
void add_element (const char *key, float val)
 Don't use these, will became private. More...
 
void add_element (const char *key, int val)
 Don't use these, will became private. More...
 
void add_element (const char *key, unsigned int val)
 Don't use these, will became private. More...
 
void add_element (const char *key, bool val)
 Don't use these, will became private. More...
 
void add_element (const char *key, const char *val)
 Don't use these, will became private. More...
 
void add_element (const char *key, const std::string &val)
 Don't use these, will became private. More...
 

Private Attributes

std::vector< Md_elemententries_
 The. More...
 

Detailed Description

A class to hold meta data.

Constructor & Destructor Documentation

Md_store::~Md_store ( )

Destructor.

Md_store::Md_store ( )

Default constructor.

Md_store::Md_store ( const utilities::Attr_list_hdf atr_lst)

Member Function Documentation

void Md_store::add_element ( const std::string &  key,
const std::string &  type,
const std::string &  value 
)
void Md_store::add_element ( const char *  key,
const char *  type,
const char *  value 
)

Don't use these, will became private.

Adds an element with the given (key,val)

References add_element().

void Md_store::add_element ( const char *  key,
float  val 
)

Don't use these, will became private.

Adds an element with the given (key,val)

References entries_, and utilities::V_FLOAT.

void Md_store::add_element ( const char *  key,
int  val 
)

Don't use these, will became private.

Adds an element with the given (key,val)

References entries_, and utilities::V_INT.

void Md_store::add_element ( const char *  key,
unsigned int  val 
)

Don't use these, will became private.

Adds an element with the given (key,val)

References entries_, and utilities::V_UINT.

void Md_store::add_element ( const char *  key,
bool  val 
)

Don't use these, will became private.

Adds an element with the given (key,val)

References entries_, and utilities::V_BOOL.

void Md_store::add_element ( const char *  key,
const char *  val 
)

Don't use these, will became private.

Adds an element with the given (key,val)

References entries_, and utilities::V_STRING.

void Md_store::add_element ( const char *  key,
const std::string &  val 
)

Don't use these, will became private.

Adds an element with the given (key,val)

References entries_, and utilities::V_STRING.

void Md_store::add_elements ( const Md_store md_in)

Add all elements in md_in to this Md_store object.

References entries_.

Referenced by main(), and iden::Iden::process_frame().

bool Md_store::contains_key ( const std::string &  key) const
bool Md_store::contains_key ( const std::string &  key,
unsigned int &  indx 
) const

Returns true if the stanza contains a pram with the given key.

If it contains the key indx is the location.

Parameters
[in]keykey to look for
[out]indxlocation of the key, returns len+1 if key does not exist
Returns
if the key exists

References entries_.

std::string utilities::Md_store::get_key ( int  j) const
inline
int Md_store::get_key_index ( const std::string &  key) const

Returns the index of the given key in the internal structure.

References entries_.

Referenced by utilities::Read_config::get_key_index(), get_value(), utilities::Read_config::get_value(), and main().

utilities::V_TYPE utilities::Md_store::get_type ( int  j) const
inline
void* utilities::Md_store::get_val ( int  j) const
inline

Returns the value as a (void *)

References entries_.

Referenced by utilities::Wrapper_o_hdf_group::add_meta_store(), and main().

template<class T >
T Md_store::get_value ( const std::string &  attr_name,
T &  val 
) const
float Md_store::get_value ( int  j,
float &  val 
) const

Returns value at index j.

The value is returned by reference. The function returns the value.

References entries_, utilities::V_FLOAT, and utilities::VT2str_s().

int Md_store::get_value ( int  j,
int &  val 
) const

Gets value at index j.

The value is returned by reference. The function either returns the value.

References entries_, utilities::V_INT, utilities::V_UINT, and utilities::VT2str_s().

unsigned int Md_store::get_value ( int  j,
unsigned int &  val 
) const

Gets value at index j.

The value is returned by reference. The function either returns the value.

References entries_, utilities::V_INT, utilities::V_UINT, and utilities::VT2str_s().

string Md_store::get_value ( int  j,
std::string &  val 
) const

Gets value at index j.

The value is returned by reference. The function returns as well the value.

References entries_, utilities::V_GUID, utilities::V_STRING, utilities::V_TIME, and utilities::VT2str_s().

bool Md_store::get_value ( int  j,
bool &  val 
) const

Gets value at index j.

The value is returned by reference. The function returns as well the value.

References entries_, utilities::V_BOOL, and utilities::VT2str_s().

void Md_store::print ( ) const
bool Md_store::remove_key ( const std::string &  key)

removes a given key

Returns
true if found and removed, false if not found

References entries_.

Referenced by set_value().

template<class T >
template void Md_store::set_value ( const std::string &  attr_name,
const T &  val,
bool  over_write = true 
)

Sets a given (key,val) pair.

Parameters
[in]attr_nameattribute name
[in]valthe value

References add_element(), and remove_key().

Referenced by utilities::Generic_wrapper_hdf::get_meta_data(), tracking::Corr_pair_diffusion::out_to_wrapper(), and test_fun().

unsigned int utilities::Md_store::size ( ) const
inline

Member Data Documentation

std::vector<Md_element> utilities::Md_store::entries_
private

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