Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
datatools::configuration::base_dependency_logic Class Referenceabstract

Base class for variant enabling logic predicates. More...

#include <bayeux/datatools/configuration/variant_dependency_logic.h>

Inheritance diagram for datatools::configuration::base_dependency_logic:
datatools::i_tree_dumpable datatools::configuration::and_logic datatools::configuration::not_logic datatools::configuration::or_logic datatools::configuration::slot_logic datatools::configuration::xor_logic

Public Types

typedef std::map< unsigned int, dependency_logic_ptr_typeinput_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_logicconnect (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_repositoryget_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_dependencyget_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_)
 

Detailed Description

Base class for variant enabling logic predicates.

Member Typedef Documentation

◆ input_dict_type

Dictionary of input ports.

Constructor & Destructor Documentation

◆ base_dependency_logic()

datatools::configuration::base_dependency_logic::base_dependency_logic ( variant_dependency )

Constructor.

◆ ~base_dependency_logic()

virtual datatools::configuration::base_dependency_logic::~base_dependency_logic ( )
virtual

Destructor.

Member Function Documentation

◆ _grab_owner_dependency()

variant_dependency& datatools::configuration::base_dependency_logic::_grab_owner_dependency ( )
protected

Return the mutable reference to the owner dependency.

◆ check_active_variant()

bool datatools::configuration::base_dependency_logic::check_active_variant ( const variant_object_info ) const

Check if a given variant is active.

◆ connect() [1/2]

void datatools::configuration::base_dependency_logic::connect ( const unsigned int  input_port_,
dependency_logic_ptr_type  logic_ 
)

Connect an input port to a logic.

◆ connect() [2/2]

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.

◆ connect_dependee()

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.

◆ disconnect()

void datatools::configuration::base_dependency_logic::disconnect ( const unsigned int  input_port_)

Disconnect an input port from a logic.

◆ get_owner_dependency()

const variant_dependency& datatools::configuration::base_dependency_logic::get_owner_dependency ( ) const

Return the const reference to the owner dependency.

◆ get_repository()

const variant_repository& datatools::configuration::base_dependency_logic::get_repository ( ) const

Return the repository handle.

◆ guid()

virtual const char* datatools::configuration::base_dependency_logic::guid ( ) const
pure virtual

◆ is_valid()

virtual bool datatools::configuration::base_dependency_logic::is_valid ( ) const
virtual

Check validity.

Reimplemented in datatools::configuration::slot_logic.

◆ max_ports()

virtual std::size_t datatools::configuration::base_dependency_logic::max_ports ( ) const
virtual

Return the maximum number of input ports.

Reimplemented in datatools::configuration::not_logic, and datatools::configuration::slot_logic.

◆ min_ports()

virtual std::size_t datatools::configuration::base_dependency_logic::min_ports ( ) const
virtual

Return the minimum number of input ports.

Reimplemented in datatools::configuration::slot_logic.

◆ operator()()

virtual bool datatools::configuration::base_dependency_logic::operator() ( ) const
pure virtual

◆ tree_dump()

virtual void datatools::configuration::base_dependency_logic::tree_dump ( std::ostream &  out_ = std::clog,
const std::string &  title_ = "",
const std::string &  indent_ = "",
bool  inherit_ = false 
) const
virtual

Smart print.

Reimplemented from datatools::i_tree_dumpable.

Reimplemented in datatools::configuration::slot_logic.

Member Data Documentation

◆ _inputs

input_dict_type datatools::configuration::base_dependency_logic::_inputs
protected

Connected input ports.

◆ _repository

const variant_repository* datatools::configuration::base_dependency_logic::_repository = nullptr
protected

The handle to the parent repository.


The documentation for this class was generated from the following file: