A variant dependency associated a depender variant object o a set of dependee variants. The object may be one of the following types:
More...
|
| 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 |
|
A variant dependency associated a depender variant object o a set of dependee variants. The object may be one of the following types:
- a variant registry,
- a variant,
- a group of parameter values,
- a specific parameter string value. An embedded logic object implements the criterion used to resolve the activation of the depender with respect to the dependees. Currently the only supported logic is the default AND(...) operator which implies that all dependees are active to activate the depender.
General dependency scheme:
The logic object The collection of dependees
compute the final dependee addressed by slot numbers
"enable" bit slots
:
unique some : +------------+
output input v | |
port ports ,--[0]s Dependee#0 |
: : / | (variant) |
v v v +------------+
+------------+ +--------+ / +------------+
| | | i[0]--' | |
| Depender e-<--o Logic i[1]----<----[3]s Dependee#1 |
| | | i[2]--, | (variant) |
+------------+ +--------+ \ +------------+
^ ^ +------------+
: \ | |
: `--[9]s Dependee#2 |
enable bit | (variant) |
associated to the depender +------------+
- See also
- For the definition of depender/dependee terms: https://en.wiktionary.org/wiki/dependee
void datatools::configuration::variant_dependency::_install_default_logic |
( |
| ) |
|
|
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:
+-------+ +----------+
,--o SLOT |<==[0]s Dependee |
+-------+ / | logic | +----------+
| AND i[0]--<--' +-------+
o |
| logic i[1]--<--,
+-------+ \ +-------+ +----------+
`--o SLOT |<==[7]s Dependee |
| logic | +----------+
+-------+
It there is only one dependee, then the embedded logic is a single SLOT logic connected to the unique dependee slot:
+-------+
| SLOT | +----------+
o |<==[1]s Dependee |
| logic | +----------+
+-------+