![]() |
Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
A variant dependency associated a depender variant object o a set of dependee variants. The object may be one of the following types: More...
#include <bayeux/datatools/configuration/variant_dependency.h>
Public Types | |
typedef std::map< unsigned int, variant_object_info > | dependee_dict_type |
![]() | |
enum | ostream_type { OSTREAM_COUT = 1, OSTREAM_CERR = 2, OSTREAM_CLOG = 3 } |
Enumeration for standard output streams. More... | |
Public Member Functions | |
variant_dependency (const variant_repository &repository_) | |
Constructor. More... | |
variant_dependency (const variant_registry ®istry_) | |
Constructor. More... | |
~variant_dependency () | |
Destructor. More... | |
bool | has_repository () const |
Check repository. More... | |
const variant_repository & | get_repository () const |
Return the repository handle. More... | |
bool | has_registry () const |
Check registry. More... | |
const variant_registry & | get_registry () const |
Return the repository handle. More... | |
bool | has_global_scope () const |
Check registry. More... | |
bool | has_local_scope () const |
Check registry. More... | |
bool | is_local () const |
Check if the dependency model is local to a registry. More... | |
bool | is_valid () const |
Check validity. More... | |
void | set_depender_by_path (const std::string &depender_name_, bool registry_scope_=false) |
Set the depender from its identifier. More... | |
void | set_depender (const variant_object_info &depender_) |
Set the depender. More... | |
const variant_object_info & | get_depender () const |
Return the depender. More... | |
std::size_t | get_number_of_dependees () const |
Return the number of dependee slots. More... | |
unsigned int | add_dependee_by_path (const std::string &dependee_path_, const unsigned int slot_=std::numeric_limits< unsigned int >::max()) |
Associate a dependee from its identifier to a slot. More... | |
unsigned int | add_dependee (const variant_object_info &dependee_, const unsigned int slot_=std::numeric_limits< unsigned int >::max()) |
Associate a dependee to a slot. More... | |
void | build_list_of_dependee_slots (std::set< unsigned int > &slots_) const |
Build set of dependee slots. More... | |
bool | has_dependee (const unsigned int slot_) const |
Check if a dependee is set at given slot. More... | |
bool | has_dependee_by_path (const std::string &dependee_path_) const |
Check if a dependee is set with given path. More... | |
const variant_object_info & | get_dependee (const unsigned int slot_) const |
Return the dependee associated to a given slot. 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... | |
base_dependency_logic & | create_logic (const std::string &guid_) |
Instantiate the embedded predicate: More... | |
const base_dependency_logic & | get_logic () const |
Return the embedded predicate. More... | |
base_dependency_logic & | grab_logic () |
Return the embedded predicate. More... | |
void | build_logic_from_formula (const std::string &logic_expression_) |
Buil the logic from formula. More... | |
bool | is_locked () const |
Check if dependency is locked. More... | |
void | lock () |
Lock the dependency. More... | |
bool | operator() () const |
Check if the dependency is fulfilled. 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... | |
![]() | |
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 | _lock () |
void | _check () |
void | _install_default_logic () |
Additional Inherited Members | |
![]() | |
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_) |
A variant dependency associated a depender variant object o a set of dependee variants. The object may be one of the following types:
General dependency scheme:
typedef std::map<unsigned int, variant_object_info> datatools::configuration::variant_dependency::dependee_dict_type |
datatools::configuration::variant_dependency::variant_dependency | ( | const variant_repository & | repository_ | ) |
Constructor.
datatools::configuration::variant_dependency::variant_dependency | ( | const variant_registry & | registry_ | ) |
Constructor.
datatools::configuration::variant_dependency::~variant_dependency | ( | ) |
Destructor.
|
protected |
|
protected |
Build and install a default logic object is no formula/expresion has been explicitely given.
If there are several dependees, we force an AND operator: all dependees must be fulfilled to enable the dependency:
It there is only one dependee, then the embedded logic is a single SLOT logic connected to the unique dependee slot:
|
protected |
unsigned int datatools::configuration::variant_dependency::add_dependee | ( | const variant_object_info & | dependee_, |
const unsigned int | slot_ = std::numeric_limits< unsigned int >::max() |
||
) |
Associate a dependee to a slot.
unsigned int datatools::configuration::variant_dependency::add_dependee_by_path | ( | const std::string & | dependee_path_, |
const unsigned int | slot_ = std::numeric_limits< unsigned int >::max() |
||
) |
Associate a dependee from its identifier to a slot.
void datatools::configuration::variant_dependency::build_list_of_dependee_slots | ( | std::set< unsigned int > & | slots_ | ) | const |
Build set of dependee slots.
void datatools::configuration::variant_dependency::build_logic_from_formula | ( | const std::string & | logic_expression_ | ) |
Buil the logic from formula.
base_dependency_logic& datatools::configuration::variant_dependency::create_logic | ( | const std::string & | guid_ | ) |
Instantiate the embedded predicate:
const variant_object_info& datatools::configuration::variant_dependency::get_dependee | ( | const unsigned int | slot_ | ) | const |
Return the dependee associated to a given slot.
const variant_object_info& datatools::configuration::variant_dependency::get_depender | ( | ) | const |
Return the depender.
datatools::logger::priority datatools::configuration::variant_dependency::get_logging | ( | ) | const |
Return the logging priority threshold.
const base_dependency_logic& datatools::configuration::variant_dependency::get_logic | ( | ) | const |
Return the embedded predicate.
std::size_t datatools::configuration::variant_dependency::get_number_of_dependees | ( | ) | const |
Return the number of dependee slots.
const variant_registry& datatools::configuration::variant_dependency::get_registry | ( | ) | const |
Return the repository handle.
const variant_repository& datatools::configuration::variant_dependency::get_repository | ( | ) | const |
Return the repository handle.
base_dependency_logic& datatools::configuration::variant_dependency::grab_logic | ( | ) |
Return the embedded predicate.
bool datatools::configuration::variant_dependency::has_dependee | ( | const unsigned int | slot_ | ) | const |
Check if a dependee is set at given slot.
bool datatools::configuration::variant_dependency::has_dependee_by_path | ( | const std::string & | dependee_path_ | ) | const |
Check if a dependee is set with given path.
bool datatools::configuration::variant_dependency::has_global_scope | ( | ) | const |
Check registry.
bool datatools::configuration::variant_dependency::has_local_scope | ( | ) | const |
Check registry.
bool datatools::configuration::variant_dependency::has_registry | ( | ) | const |
Check registry.
bool datatools::configuration::variant_dependency::has_repository | ( | ) | const |
Check repository.
bool datatools::configuration::variant_dependency::is_local | ( | ) | const |
Check if the dependency model is local to a registry.
bool datatools::configuration::variant_dependency::is_locked | ( | ) | const |
Check if dependency is locked.
bool datatools::configuration::variant_dependency::is_valid | ( | ) | const |
Check validity.
void datatools::configuration::variant_dependency::lock | ( | ) |
Lock the dependency.
bool datatools::configuration::variant_dependency::operator() | ( | ) | const |
Check if the dependency is fulfilled.
void datatools::configuration::variant_dependency::set_depender | ( | const variant_object_info & | depender_ | ) |
Set the depender.
void datatools::configuration::variant_dependency::set_depender_by_path | ( | const std::string & | depender_name_, |
bool | registry_scope_ = false |
||
) |
Set the depender from its identifier.
void datatools::configuration::variant_dependency::set_logging | ( | const datatools::logger::priority | ) |
Set the logging priority threshold.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.