Particle Identification and Tracking
|
A class to hold meta data. More...
#include <md_store.h>
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 > | |
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_element > | entries_ |
The. More... | |
A class to hold meta data.
Md_store::~Md_store | ( | ) |
Destructor.
Md_store::Md_store | ( | ) |
Default constructor.
Md_store::Md_store | ( | const utilities::Attr_list_hdf & | atr_lst) |
Constructor from an attr_list.
References add_element(), utilities::Attr_list_hdf::contents(), utilities::Attr_list_hdf::get_type(), utilities::Attr_list_hdf::get_value(), string_str, utilities::V_FLOAT, utilities::V_INT, utilities::V_STRING, and utilities::V_UINT.
void Md_store::add_element | ( | const std::string & | key, |
const std::string & | type, | ||
const std::string & | value | ||
) |
Don't use these, will became private.
Adds an element with the given (key,val)
References contains_key(), entries_, utilities::str2VT_s(), utilities::V_BOOL, utilities::V_COMPLEX, utilities::V_ERROR, utilities::V_FLOAT, utilities::V_GUID, utilities::V_INT, utilities::V_STRING, utilities::V_TIME, and utilities::V_UINT.
Referenced by add_element(), utilities::extract_prams(), iden::Iden::fill_wrapper(), iden::Iden::fill_wrapper_avg(), utilities::SQL_handler::get_comp_mdata(), utilities::Filter_ers::get_parameters(), utilities::Filter_ersI::get_parameters(), main(), Md_store(), parse_description(), iden::Mm_md_parser::parse_elements(), utilities::Read_config::Read_config(), set_value(), and test_fun().
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 |
Returns true if the stanza contains a pram with the given key.
Referenced by add_element(), tracking::Hash_shelf::compute_corr(), utilities::Read_config::contains_key(), iden::Iden::fill_wrapper(), utilities::filter_factory(), and tracking::Accum_chi4_self::out_to_wrapper().
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.
[in] | key | key to look for |
[out] | indx | location of the key, returns len+1 if key does not exist |
References entries_.
|
inline |
Returns the key at j in the internal structure.
References entries_.
Referenced by utilities::Generic_wrapper_hdf::add_meta_data(), utilities::Wrapper_o_hdf_group::add_meta_store(), utilities::Read_config::get_key(), and main().
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().
|
inline |
Returns the type at j in the internal structure.
References entries_.
Referenced by utilities::Generic_wrapper_hdf::add_meta_data(), utilities::Wrapper_o_hdf_group::add_meta_store(), utilities::Read_config::get_type(), and main().
|
inline |
Returns the value as a (void *)
References entries_.
Referenced by utilities::Wrapper_o_hdf_group::add_meta_store(), and main().
T Md_store::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 get_key_index().
Referenced by utilities::SQL_handler::add_mdata(), utilities::Generic_wrapper_hdf::add_meta_data(), utilities::Wrapper_o_hdf_group::add_meta_store(), tracking::Hash_shelf::compute_corr(), iden::Iden::fill_wrapper(), iden::Iden::fill_wrapper_avg(), tracking::hash_case::get_avg_dtime(), tracking::hash_case::get_avg_temp(), utilities::Read_config::get_value(), utilities::SQL_handler::gofr_by_plane_md_fun(), utilities::SQL_handler::gofr_md_fun(), utilities::SQL_handler::iden_md_fun(), utilities::Filter_ers::init(), utilities::Filter_ersI::init(), main(), utilities::SQL_handler::msd_md_fun(), utilities::SQL_handler::msd_sweep_md_fun(), tracking::Accum_chi4_self::out_to_wrapper(), tracking::TA_vanHove::output_to_wrapper(), tracking::TA_disp::output_to_wrapper(), tracking::TA_theta_rlim::output_to_wrapper(), tracking::TA_msd::output_to_wrapper(), tracking::Track_shelf::output_to_wrapper(), utilities::SQL_handler::phi6_md_fun(), test_fun(), utilities::SQL_handler::tracking_md_fun(), and utilities::SQL_handler::vanHove_md_fun().
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 |
Print out the contents.
References entries_, utilities::V_BOOL, utilities::V_COMPLEX, utilities::V_ERROR, utilities::V_FLOAT, utilities::V_GUID, utilities::V_INT, utilities::V_STRING, utilities::V_TIME, utilities::V_UINT, and utilities::VT2str_s().
Referenced by main(), utilities::Read_config::print(), and test_fun().
bool Md_store::remove_key | ( | const std::string & | key) |
removes a given key
References entries_.
Referenced by set_value().
template void Md_store::set_value | ( | const std::string & | attr_name, |
const T & | val, | ||
bool | over_write = true |
||
) |
Sets a given (key,val) pair.
[in] | attr_name | attribute name |
[in] | val | the 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().
|
inline |
Returns the number of parsed prams.
References entries_.
Referenced by utilities::Generic_wrapper_hdf::add_meta_data(), utilities::Wrapper_o_hdf_group::add_meta_store(), main(), and utilities::Read_config::size().
|
private |
The.
Referenced by add_element(), add_elements(), contains_key(), get_key(), get_key_index(), get_type(), get_val(), get_value(), print(), remove_key(), and size().