Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
Base class for variant enabling logic predicates. More...
#include <bayeux/datatools/configuration/variant_dependency_logic.h>
Public Types | |
typedef std::map< unsigned int, dependency_logic_ptr_type > | input_dict_type |
Dictionary of input ports. 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 | |
base_dependency_logic (variant_dependency &) | |
Constructor. More... | |
virtual | ~base_dependency_logic () |
Destructor. More... | |
virtual const char * | guid () const =0 |
Return the global unique class identifier. More... | |
virtual std::size_t | min_ports () const |
Return the minimum number of input ports. More... | |
virtual std::size_t | max_ports () const |
Return the maximum number of input ports. More... | |
virtual bool | is_valid () const |
Check validity. More... | |
virtual bool | operator() () const =0 |
Check the logic. More... | |
bool | check_active_variant (const variant_object_info &) const |
Check if a given variant is active. More... | |
void | connect (const unsigned int input_port_, dependency_logic_ptr_type logic_) |
Connect an input port to a logic. More... | |
void | disconnect (const unsigned int input_port_) |
Disconnect an input port from a logic. More... | |
base_dependency_logic & | connect (const unsigned int input_port_, const std::string &guid_) |
Connect input port to the ouput of the created logic. More... | |
void | connect_dependee (const unsigned int input_port_, const unsigned int dependee_slot_) |
Connect input port to the dependee variant at given slot. More... | |
const variant_repository & | get_repository () const |
Return the repository handle. 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... | |
const variant_dependency & | get_owner_dependency () const |
Return the const reference to the owner dependency. 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 | |
variant_dependency & | _grab_owner_dependency () |
Return the mutable reference to the owner dependency. More... | |
Protected Attributes | |
const variant_repository * | _repository = nullptr |
The handle to the parent repository. More... | |
input_dict_type | _inputs |
Connected input ports. 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_) |
Base class for variant enabling logic predicates.
typedef std::map<unsigned int, dependency_logic_ptr_type> datatools::configuration::base_dependency_logic::input_dict_type |
Dictionary of input ports.
datatools::configuration::base_dependency_logic::base_dependency_logic | ( | variant_dependency & | ) |
Constructor.
|
virtual |
Destructor.
|
protected |
Return the mutable reference to the owner dependency.
bool datatools::configuration::base_dependency_logic::check_active_variant | ( | const variant_object_info & | ) | const |
Check if a given variant is active.
void datatools::configuration::base_dependency_logic::connect | ( | const unsigned int | input_port_, |
dependency_logic_ptr_type | logic_ | ||
) |
Connect an input port to a logic.
base_dependency_logic& datatools::configuration::base_dependency_logic::connect | ( | const unsigned int | input_port_, |
const std::string & | guid_ | ||
) |
Connect input port to the ouput of the created logic.
void datatools::configuration::base_dependency_logic::connect_dependee | ( | const unsigned int | input_port_, |
const unsigned int | dependee_slot_ | ||
) |
Connect input port to the dependee variant at given slot.
void datatools::configuration::base_dependency_logic::disconnect | ( | const unsigned int | input_port_ | ) |
Disconnect an input port from a logic.
const variant_dependency& datatools::configuration::base_dependency_logic::get_owner_dependency | ( | ) | const |
Return the const reference to the owner dependency.
const variant_repository& datatools::configuration::base_dependency_logic::get_repository | ( | ) | const |
Return the repository handle.
|
pure virtual |
Return the global unique class identifier.
Implemented in datatools::configuration::xor_logic, datatools::configuration::or_logic, datatools::configuration::and_logic, datatools::configuration::not_logic, and datatools::configuration::slot_logic.
|
virtual |
Check validity.
Reimplemented in datatools::configuration::slot_logic.
|
virtual |
Return the maximum number of input ports.
Reimplemented in datatools::configuration::not_logic, and datatools::configuration::slot_logic.
|
virtual |
Return the minimum number of input ports.
Reimplemented in datatools::configuration::slot_logic.
|
pure virtual |
Check the logic.
Implemented in datatools::configuration::xor_logic, datatools::configuration::or_logic, datatools::configuration::and_logic, datatools::configuration::not_logic, and datatools::configuration::slot_logic.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
Reimplemented in datatools::configuration::slot_logic.
|
protected |
Connected input ports.
|
protected |
The handle to the parent repository.