Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
Model of variant dependencies associated to a variant repository. More...
#include <bayeux/datatools/configuration/variant_dependency_model.h>
Classes | |
struct | dependee_record |
Description of a dependee slot: More... | |
struct | dependency_record |
Description of a dependency: More... | |
Public Types | |
enum | rst_flags { PRINT_RST_NO_TITLE = datatools::bit_mask::bit00, PRINT_RST_NO_SCOPE = datatools::bit_mask::bit01 } |
Restructured text formatting. More... | |
typedef std::map< unsigned int, dependee_record > | dependee_record_dict_type |
typedef std::map< std::string, dependency_record > | dependency_record_dict_type |
typedef std::shared_ptr< variant_dependency > | dependency_ptr_type |
typedef std::map< std::string, dependency_ptr_type > | dependency_dict_type |
typedef std::map< std::string, std::set< std::string > > | dependers_table_type |
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 | |
variant_dependency_model (const variant_repository &repository_) | |
Constructor. More... | |
variant_dependency_model (const variant_registry ®istry_) | |
Constructor. More... | |
bool | has_repository () const |
Check repository. More... | |
const variant_repository & | get_repository () const |
Return the repository. More... | |
bool | has_registry () const |
Check registry. More... | |
const variant_registry & | get_registry () const |
Return the registry. More... | |
datatools::logger::priority | get_logging () const |
Return the logging priority threshold. More... | |
void | set_logging (const datatools::logger::priority) |
Set the logging priority threshold. More... | |
bool | is_local () const |
Check if the dependency model is local to a registry. More... | |
bool | has_dependee_record_by_path (const std::string &dependee_path_) const |
Check if a variant is used as a dependee. More... | |
bool | has_dependee_record (unsigned int slot_) const |
Check if a dependee is set at given slot. More... | |
unsigned int | add_dependee_record (unsigned int slot_, const std::string &dependee_path_) |
Add a dependee at given slot. More... | |
const std::string & | get_dependee_record_path (unsigned int slot_) const |
Return the dependee path at given slot. More... | |
const dependee_record_dict_type & | get_dependee_records () const |
Return the dictionary of dependee records. More... | |
void | build_list_of_dependee_slots (std::set< unsigned int > &dep_slots_) const |
Build the list of dependee slots. More... | |
bool | has_dependency_record (const std::string &name_) const |
Check if a dependency record is set. More... | |
bool | has_dependency_record_by_depender_path (const std::string &name_) const |
Check if a dependency is set given its depender path. More... | |
void | build_list_of_dependency_records (std::set< std::string > &dep_names_) const |
Build the list of dependency records by name. More... | |
void | add_dependency_record (const std::string &name_, const std::string &depender_path_, const std::set< unsigned int > &input_slots_, const std::string &logic_expression_="", const datatools::logger::priority logging_=datatools::logger::PRIO_FATAL) |
Add a dependency. More... | |
const dependency_record_dict_type & | get_dependency_records () const |
Return the dictionary of dependency records. More... | |
bool | is_valid () const |
Check validity. More... | |
bool | is_initialized () const |
Check initialization flag. More... | |
void | initialize (const datatools::properties &config_) |
Initialization. More... | |
void | reset () |
Reset. More... | |
virtual void | tree_dump (std::ostream &out_=std::clog, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const |
Smart print. More... | |
bool | has_dependency (const std::string &path_) const |
Check if a dependency is associated to a variant object given its path. More... | |
const variant_dependency & | get_dependency (const std::string &path_) const |
Return the dependency associated to a variant object given its path. More... | |
const dependency_ptr_type & | get_dependency_ptr (const std::string &path_) const |
Return the handle on the dependency associated to a variant object given its path. More... | |
const dependency_dict_type & | get_dependencies () const |
Return the collection of dependencies. More... | |
const dependers_table_type & | get_dependers_per_dependee () const |
Return the table of dependers' paths addressed by their respective dependees' paths. More... | |
void | print_rst (std::ostream &out_, const uint32_t flags_=0, const std::string &indent_="") const |
Print documentation. 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 |
Protected Member Functions | |
void | _at_init () |
void | _at_init_build_table_of_dependers_ () |
void | _at_reset () |
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_) |
Model of variant dependencies associated to a variant repository.
Dictionary of dependee slots: each dependee of interest publishes its activation state to a specific slot with unique slot ID:
Dictionary of dependencies: each dependency computes its state from a logic which is connected to a set of input slots:
typedef std::map<unsigned int, dependee_record> datatools::configuration::variant_dependency_model::dependee_record_dict_type |
typedef std::map<std::string, dependency_ptr_type> datatools::configuration::variant_dependency_model::dependency_dict_type |
typedef std::shared_ptr<variant_dependency> datatools::configuration::variant_dependency_model::dependency_ptr_type |
typedef std::map<std::string, dependency_record> datatools::configuration::variant_dependency_model::dependency_record_dict_type |
typedef std::map<std::string, std::set<std::string> > datatools::configuration::variant_dependency_model::dependers_table_type |
datatools::configuration::variant_dependency_model::variant_dependency_model | ( | const variant_repository & | repository_ | ) |
Constructor.
datatools::configuration::variant_dependency_model::variant_dependency_model | ( | const variant_registry & | registry_ | ) |
Constructor.
|
protected |
|
protected |
|
protected |
unsigned int datatools::configuration::variant_dependency_model::add_dependee_record | ( | unsigned int | slot_, |
const std::string & | dependee_path_ | ||
) |
Add a dependee at given slot.
void datatools::configuration::variant_dependency_model::add_dependency_record | ( | const std::string & | name_, |
const std::string & | depender_path_, | ||
const std::set< unsigned int > & | input_slots_, | ||
const std::string & | logic_expression_ = "" , |
||
const datatools::logger::priority | logging_ = datatools::logger::PRIO_FATAL |
||
) |
Add a dependency.
void datatools::configuration::variant_dependency_model::build_list_of_dependee_slots | ( | std::set< unsigned int > & | dep_slots_ | ) | const |
Build the list of dependee slots.
void datatools::configuration::variant_dependency_model::build_list_of_dependency_records | ( | std::set< std::string > & | dep_names_ | ) | const |
Build the list of dependency records by name.
const std::string& datatools::configuration::variant_dependency_model::get_dependee_record_path | ( | unsigned int | slot_ | ) | const |
Return the dependee path at given slot.
const dependee_record_dict_type& datatools::configuration::variant_dependency_model::get_dependee_records | ( | ) | const |
Return the dictionary of dependee records.
const dependency_dict_type& datatools::configuration::variant_dependency_model::get_dependencies | ( | ) | const |
Return the collection of dependencies.
const variant_dependency& datatools::configuration::variant_dependency_model::get_dependency | ( | const std::string & | path_ | ) | const |
Return the dependency associated to a variant object given its path.
const dependency_ptr_type& datatools::configuration::variant_dependency_model::get_dependency_ptr | ( | const std::string & | path_ | ) | const |
Return the handle on the dependency associated to a variant object given its path.
const dependency_record_dict_type& datatools::configuration::variant_dependency_model::get_dependency_records | ( | ) | const |
Return the dictionary of dependency records.
const dependers_table_type& datatools::configuration::variant_dependency_model::get_dependers_per_dependee | ( | ) | const |
Return the table of dependers' paths addressed by their respective dependees' paths.
datatools::logger::priority datatools::configuration::variant_dependency_model::get_logging | ( | ) | const |
Return the logging priority threshold.
const variant_registry& datatools::configuration::variant_dependency_model::get_registry | ( | ) | const |
Return the registry.
const variant_repository& datatools::configuration::variant_dependency_model::get_repository | ( | ) | const |
Return the repository.
bool datatools::configuration::variant_dependency_model::has_dependee_record | ( | unsigned int | slot_ | ) | const |
Check if a dependee is set at given slot.
bool datatools::configuration::variant_dependency_model::has_dependee_record_by_path | ( | const std::string & | dependee_path_ | ) | const |
Check if a variant is used as a dependee.
bool datatools::configuration::variant_dependency_model::has_dependency | ( | const std::string & | path_ | ) | const |
Check if a dependency is associated to a variant object given its path.
bool datatools::configuration::variant_dependency_model::has_dependency_record | ( | const std::string & | name_ | ) | const |
Check if a dependency record is set.
bool datatools::configuration::variant_dependency_model::has_dependency_record_by_depender_path | ( | const std::string & | name_ | ) | const |
Check if a dependency is set given its depender path.
bool datatools::configuration::variant_dependency_model::has_registry | ( | ) | const |
Check registry.
bool datatools::configuration::variant_dependency_model::has_repository | ( | ) | const |
Check repository.
void datatools::configuration::variant_dependency_model::initialize | ( | const datatools::properties & | config_ | ) |
Initialization.
bool datatools::configuration::variant_dependency_model::is_initialized | ( | ) | const |
Check initialization flag.
bool datatools::configuration::variant_dependency_model::is_local | ( | ) | const |
Check if the dependency model is local to a registry.
bool datatools::configuration::variant_dependency_model::is_valid | ( | ) | const |
Check validity.
void datatools::configuration::variant_dependency_model::print_rst | ( | std::ostream & | out_, |
const uint32_t | flags_ = 0 , |
||
const std::string & | indent_ = "" |
||
) | const |
Print documentation.
void datatools::configuration::variant_dependency_model::reset | ( | ) |
Reset.
void datatools::configuration::variant_dependency_model::set_logging | ( | const datatools::logger::priority | ) |
Set the logging priority threshold.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.