Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
The cut abstract base class (interface) More...
#include <bayeux/cuts/i_cut.h>
Classes | |
struct | i_referenced_data |
An abstract class for daughter templatized data wrapper classes. More... | |
struct | referenced_data |
A weak reference to an arbitrary object with tracked type_info More... | |
Public Types | |
enum | export_config_flags { EXPORT_CONFIG_CLEAR = datatools::bit_mask::bit00, EXPORT_CONFIG_NAME = datatools::bit_mask::bit01, EXPORT_CONFIG_DESCRIPTION = datatools::bit_mask::bit02, EXPORT_CONFIG_VERSION = datatools::bit_mask::bit03, EXPORT_CONFIG_LOGGING_PRIORITY = datatools::bit_mask::bit04, EXPORT_CONFIG_DEFAULT, EXPORT_CONFIG_LAST = EXPORT_CONFIG_LOGGING_PRIORITY } |
Flags for export to a container of properties. 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 | |
bool | is_debug () const |
Check if logging priority is at least at debug level. More... | |
bool | has_name () const |
Check if the name of the cut is set. More... | |
void | set_name (const std::string &a_name) |
Set the name of the cut. More... | |
const std::string & | get_name () const |
Return the name of the cut. More... | |
bool | has_description () const |
Check if the description of the cut is set. More... | |
const std::string & | get_description () const |
Return the description of the cut. More... | |
void | set_description (const std::string &a_description) |
Set the description of the cut. More... | |
bool | has_version () const |
Check if the version of the cut is set. More... | |
const std::string & | get_version () const |
Return the version of the cut. More... | |
void | set_version (const std::string &a_version) |
Return the version of the cut. More... | |
bool | is_initialized () const |
Check initialization status. More... | |
bool | has_user_data () const |
Check if some user data is referenced. More... | |
template<class T > | |
void | set_user_data (const T &obj_) |
Set user data. More... | |
template<class T > | |
bool | is_user_data () const |
Check user data type. More... | |
template<class T > | |
const T & | get_user_data () const |
Get user data of given type. More... | |
template<class T > | |
void | register_supported_user_data_type () |
Register user data type is supported. More... | |
template<class T > | |
void | unregister_supported_user_data_type () |
Unregister user data type is supported. More... | |
template<class T > | |
bool | is_user_data_type_supported () const |
Check if data type is supported. More... | |
bool | is_user_data_type_supported (const std::type_info &tinfo_) const |
Check if a data type is supported. More... | |
void | reset_user_data () |
Clear the referenced user data. More... | |
virtual void | initialize_simple () |
Naked initialization method (default implementation,. More... | |
virtual void | initialize_standalone (const datatools::properties &a_config) |
Initialization method through a container of configuration properties (default implementation,. More... | |
virtual void | initialize_with_service_only (const datatools::properties &a_config, datatools::service_manager &a_service_manager) |
virtual void | initialize_without_service (const datatools::properties &a_config, cut_handle_dict_type &a_cut_dictionary) |
virtual void | initialize (const datatools::properties &a_config, datatools::service_manager &a_service_manager, cut_handle_dict_type &a_cut_dictionary)=0 |
virtual void | export_to_config (datatools::properties &config_, uint32_t flags_=EXPORT_CONFIG_DEFAULT, const std::string &prefix_="") const |
Export to a container of properties. More... | |
virtual int | process () |
int | operator() () |
Function interface for the selection method. More... | |
virtual void | reset ()=0 |
The main termination method. More... | |
i_cut (datatools::logger::priority p=datatools::logger::PRIO_FATAL) | |
Constructor. More... | |
virtual | ~i_cut () |
Destructor. More... | |
virtual void | tree_dump (std::ostream &a_out=std::clog, const std::string &a_title="", const std::string &a_indent="", bool a_inherit=false) const |
Smart print. More... | |
void | print (std::ostream &a_out=std::clog) const |
Print shortcut. More... | |
void | set_logging_priority (datatools::logger::priority p) |
Set the logging priority threshold. More... | |
datatools::logger::priority | get_logging_priority () const |
Get the logging priority threshold. More... | |
size_t | get_number_of_accepted_entries () const |
Return the number of entries accepted by the cut. More... | |
size_t | get_number_of_rejected_entries () const |
Return the number of entries rejected by the cut. More... | |
size_t | get_number_of_processed_entries () const |
Return the total number of entries processed by the cut. More... | |
void | reset_counters () |
Reset the embedded counters. More... | |
bool | is_activated_counters () const |
Check the flag to activate counters. More... | |
void | set_activated_counters (bool) |
Set the flag to activate statistics. More... | |
virtual std::string | get_type_id () const =0 |
Return the unique type identifier associated to the class of the cut object. 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 |
Static Public Member Functions | |
static void | common_ocd (datatools::object_configuration_description &ocd_) |
Basic OCD support shared by all inherited modules. More... | |
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_) |
Protected Member Functions | |
virtual int | _accept ()=0 |
The main selection method (pure virtual, invoked by the. More... | |
void | _set_user_data (const boost::shared_ptr< i_referenced_data > &hd_) |
Set user data by shared pointer. More... | |
void | _common_initialize (const datatools::properties &a_config) |
Common initialization of all cuts. More... | |
void | _import_user_data_from (const i_cut &) |
Import user data from another cut. More... | |
void | _export_user_data_to (i_cut &) const |
Export user data to another cut. More... | |
void | _set_name (const std::string &a_name) |
Set the cut name. More... | |
void | _set_initialized (bool a_initialized) |
Set the initialization flag. More... | |
virtual void | _prepare_cut () |
Hook invoked before the main selection method. More... | |
virtual int | _finish_cut (int a_selection_status) |
Hook invoked after the main selection method. More... | |
virtual void | _increment_counters (int a_selection_status) |
Increment statistics counters. More... | |
virtual void | _at_set_user_data () |
Hook executed when user data is set. More... | |
virtual void | _at_reset_user_data () |
Hook executed when user data is reset. More... | |
void | _reset () |
Reset the cut. More... | |
void | _set_defaults () |
Set default attributes values. More... | |
Protected Attributes | |
datatools::logger::priority | _logging |
Logging priority threshold. More... | |
std::string | _name |
The name of the cut. More... | |
std::string | _description |
The description of the cut. More... | |
std::string | _version |
The version of the cut. More... | |
std::set< const std::type_info * > | _supported_types_ |
The set of supported user data types. More... | |
The cut abstract base class (interface)
|
explicit |
Constructor.
|
virtual |
Destructor.
|
protectedpure virtual |
The main selection method (pure virtual, invoked by the.
Implemented in dpp::utils_cut, genvtx::in_materials_vertex_validator, genvtx::not_in_daughters_vertex_validator, cuts::random_cut, cuts::not_cut, cuts::reject_cut, cuts::accept_cut, cuts::multi_and_cut, cuts::multi_or_cut, cuts::multi_xor_cut, cuts::nor_cut, cuts::and_cut, cuts::exclude_cut, cuts::or_cut, cuts::xnor_cut, cuts::xor_cut, and cuts::nand_cut.
|
protectedvirtual |
Hook executed when user data is reset.
Reimplemented in cuts::i_binary_cut, cuts::i_multi_cut, and cuts::not_cut.
|
protectedvirtual |
Hook executed when user data is set.
Reimplemented in cuts::i_binary_cut, cuts::i_multi_cut, and cuts::not_cut.
|
protected |
Common initialization of all cuts.
|
protected |
Export user data to another cut.
|
protectedvirtual |
Hook invoked after the main selection method.
|
protected |
Import user data from another cut.
|
protectedvirtual |
Increment statistics counters.
|
protectedvirtual |
Hook invoked before the main selection method.
|
protected |
Reset the cut.
|
protected |
Set default attributes values.
|
protected |
Set the initialization flag.
|
protected |
Set the cut name.
|
protected |
Set user data by shared pointer.
|
static |
Basic OCD support shared by all inherited modules.
|
virtual |
Export to a container of properties.
Reimplemented in cuts::i_multi_cut, cuts::i_binary_cut, and cuts::not_cut.
const std::string& cuts::i_cut::get_description | ( | ) | const |
Return the description of the cut.
datatools::logger::priority cuts::i_cut::get_logging_priority | ( | ) | const |
Get the logging priority threshold.
const std::string& cuts::i_cut::get_name | ( | ) | const |
Return the name of the cut.
size_t cuts::i_cut::get_number_of_accepted_entries | ( | ) | const |
Return the number of entries accepted by the cut.
size_t cuts::i_cut::get_number_of_processed_entries | ( | ) | const |
Return the total number of entries processed by the cut.
size_t cuts::i_cut::get_number_of_rejected_entries | ( | ) | const |
Return the number of entries rejected by the cut.
|
pure virtual |
Return the unique type identifier associated to the class of the cut object.
|
inline |
Get user data of given type.
const std::string& cuts::i_cut::get_version | ( | ) | const |
Return the version of the cut.
bool cuts::i_cut::has_description | ( | ) | const |
Check if the description of the cut is set.
bool cuts::i_cut::has_name | ( | ) | const |
Check if the name of the cut is set.
bool cuts::i_cut::has_user_data | ( | ) | const |
Check if some user data is referenced.
bool cuts::i_cut::has_version | ( | ) | const |
Check if the version of the cut is set.
|
pure virtual |
The main initialization method (post-construction)
a_config | the container of configuration parameters |
a_cut_dictionary | a dictionary of existing 'cuts' which can be used to build the current cut (used in the framework of a factory) |
a_service_manager | a manager for external services |
Implemented in dpp::utils_cut, cuts::i_multi_cut, cuts::i_binary_cut, cuts::random_cut, genvtx::in_materials_vertex_validator, cuts::not_cut, cuts::reject_cut, genvtx::not_in_daughters_vertex_validator, and cuts::accept_cut.
|
virtual |
Naked initialization method (default implementation,.
|
virtual |
Initialization method through a container of configuration properties (default implementation,.
|
virtual |
Initialization method through a container of configuration properties and a service manager (default implementation,
|
virtual |
Initialization method through a container of configuration properties and a dictionary of cuts (default implementation,
bool cuts::i_cut::is_activated_counters | ( | ) | const |
Check the flag to activate counters.
bool cuts::i_cut::is_debug | ( | ) | const |
Check if logging priority is at least at debug level.
bool cuts::i_cut::is_initialized | ( | ) | const |
Check initialization status.
|
inline |
Check user data type.
|
inline |
Check if data type is supported.
bool cuts::i_cut::is_user_data_type_supported | ( | const std::type_info & | tinfo_ | ) | const |
Check if a data type is supported.
int cuts::i_cut::operator() | ( | ) |
Function interface for the selection method.
void cuts::i_cut::print | ( | std::ostream & | a_out = std::clog | ) | const |
Print shortcut.
|
virtual |
The main cut processing method
|
inline |
Register user data type is supported.
|
pure virtual |
The main termination method.
Implemented in dpp::utils_cut, cuts::i_multi_cut, cuts::i_binary_cut, cuts::random_cut, cuts::not_cut, genvtx::in_materials_vertex_validator, cuts::reject_cut, genvtx::not_in_daughters_vertex_validator, and cuts::accept_cut.
void cuts::i_cut::reset_counters | ( | ) |
Reset the embedded counters.
void cuts::i_cut::reset_user_data | ( | ) |
Clear the referenced user data.
void cuts::i_cut::set_activated_counters | ( | bool | ) |
Set the flag to activate statistics.
void cuts::i_cut::set_description | ( | const std::string & | a_description | ) |
Set the description of the cut.
void cuts::i_cut::set_logging_priority | ( | datatools::logger::priority | p | ) |
Set the logging priority threshold.
void cuts::i_cut::set_name | ( | const std::string & | a_name | ) |
Set the name of the cut.
|
inline |
Set user data.
void cuts::i_cut::set_version | ( | const std::string & | a_version | ) |
Return the version of the cut.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.
Reimplemented in dpp::utils_cut, genvtx::in_materials_vertex_validator, cuts::i_binary_cut, and genvtx::not_in_daughters_vertex_validator.
|
inline |
Unregister user data type is supported.
|
protected |
The description of the cut.
|
protected |
Logging priority threshold.
|
protected |
The name of the cut.
|
protected |
The set of supported user data types.
|
protected |
The version of the cut.