Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
Store of parameters. More...
#include <bayeux/mygsl/parameter_store.h>
Classes | |
struct | i_subscriber |
Subscriber. More... | |
struct | parameter_record |
Parameter record. More... | |
Public Types | |
typedef boost::variant< bool, int, double, std::string > | param_type |
Type alias for parameter value. More... | |
typedef std::map< std::string, parameter_record > | parameter_dict_type |
Type alias for a dictionary of parameter records. More... | |
typedef std::vector< parameter_record * > | indexed_parameter_col_type |
Type alias for an array of parameter record handles. More... | |
Public Types inherited from datatools::i_tree_dumpable | |
enum | ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 } |
Enumeration for standard output streams. More... | |
Public Member Functions | |
parameter_store () | |
Default constructor. More... | |
virtual | ~parameter_store () |
Destructor. More... | |
void | reset () |
Reset the store. More... | |
int | add (const std::string &name_, datatools::basic_type type_, const std::string &description_) |
Add a parameter. More... | |
void | remove (const std::string &name_) |
Remove parameter. More... | |
bool | has (const std::string &name_) const |
Check if a parameter exists. More... | |
const parameter_record & | get (const std::string &name_) const |
Return a non mutable parameter record by name. More... | |
parameter_record & | grab (const std::string &name_) |
Return a mutable parameter record by name. More... | |
bool | index_is_valid (int index_) const |
Check if a parameter idnex is valid. More... | |
const parameter_record & | get (int index_, bool do_check_=true) const |
Return a non mutable parameter record by index. More... | |
parameter_record & | grab (int index_, bool do_check_=true) |
Return a mutable parameter record by index. More... | |
int | get_parameter_index (const std::string ¶meter_name_) const |
Return the index associated to a parameter given its name. More... | |
void | update () |
Update. More... | |
virtual void | tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const |
Main interface method for smart dump. More... | |
bool | is_registered_subscriber (const i_subscriber &s_) const |
Check is a subscriber object is currently a subscriber of the store. More... | |
void | register_subscriber (i_subscriber &) |
Register a subscriber. More... | |
void | unregister_subscriber (i_subscriber &) |
Unregister a subscriber. More... | |
Public Member Functions inherited from datatools::i_tree_dumpable | |
i_tree_dumpable () | |
Constructor. More... | |
virtual | ~i_tree_dumpable () |
Destructor. More... | |
virtual void | print_tree (std::ostream &out_=std::clog, const boost::property_tree::ptree &options_=empty_options()) const |
Main new interface method for printing. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const std::string &json_options_="") const |
Printing with jsonized options. More... | |
void | print_tree_json (std::ostream &out_=std::clog, const char *json_options_=nullptr) const |
Printing with jsonized options. More... | |
void | tree_dump_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="", const bool inherit_=false) const |
void | tree_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="") const |
void | smart_print_id (const int out_type_=OSTREAM_CLOG, const std::string &title_="", const std::string &indent_="") const |
Static Public Attributes | |
static const int | INVALID_INDEX = -1 |
Protected Member Functions | |
void | _update_parameters () |
Update parameters action. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from datatools::i_tree_dumpable | |
static const boost::property_tree::ptree & | empty_options () |
static boost::property_tree::ptree | make_base_print_options (const std::string &title_, const std::string &indent_="", const bool inherit_=false) |
static std::ostream & | last_skip_tag (std::ostream &out_) |
static std::ostream & | skip_tag (std::ostream &out_) |
static std::ostream & | last_tag (std::ostream &out_) |
static std::ostream & | tag (std::ostream &out_) |
Store of parameters.
typedef std::vector<parameter_record *> mygsl::parameter_store::indexed_parameter_col_type |
Type alias for an array of parameter record handles.
typedef boost::variant<bool, int, double, std::string> mygsl::parameter_store::param_type |
Type alias for parameter value.
typedef std::map<std::string, parameter_record> mygsl::parameter_store::parameter_dict_type |
Type alias for a dictionary of parameter records.
mygsl::parameter_store::parameter_store | ( | ) |
Default constructor.
|
virtual |
Destructor.
|
protected |
Update parameters action.
int mygsl::parameter_store::add | ( | const std::string & | name_, |
datatools::basic_type | type_, | ||
const std::string & | description_ | ||
) |
Add a parameter.
const parameter_record& mygsl::parameter_store::get | ( | const std::string & | name_ | ) | const |
Return a non mutable parameter record by name.
const parameter_record& mygsl::parameter_store::get | ( | int | index_, |
bool | do_check_ = true |
||
) | const |
Return a non mutable parameter record by index.
int mygsl::parameter_store::get_parameter_index | ( | const std::string & | parameter_name_ | ) | const |
Return the index associated to a parameter given its name.
parameter_record& mygsl::parameter_store::grab | ( | const std::string & | name_ | ) |
Return a mutable parameter record by name.
parameter_record& mygsl::parameter_store::grab | ( | int | index_, |
bool | do_check_ = true |
||
) |
Return a mutable parameter record by index.
bool mygsl::parameter_store::has | ( | const std::string & | name_ | ) | const |
Check if a parameter exists.
bool mygsl::parameter_store::index_is_valid | ( | int | index_ | ) | const |
Check if a parameter idnex is valid.
bool mygsl::parameter_store::is_registered_subscriber | ( | const i_subscriber & | s_ | ) | const |
Check is a subscriber object is currently a subscriber of the store.
void mygsl::parameter_store::register_subscriber | ( | i_subscriber & | ) |
Register a subscriber.
void mygsl::parameter_store::remove | ( | const std::string & | name_ | ) |
Remove parameter.
void mygsl::parameter_store::reset | ( | ) |
Reset the store.
|
virtual |
Main interface method for smart dump.
Reimplemented from datatools::i_tree_dumpable.
void mygsl::parameter_store::unregister_subscriber | ( | i_subscriber & | ) |
Unregister a subscriber.
void mygsl::parameter_store::update | ( | ) |
Update.
|
static |