Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cuts::i_cut Class Referenceabstract

The cut abstract base class (interface) More...

#include <bayeux/cuts/i_cut.h>

Inheritance diagram for cuts::i_cut:
datatools::i_tree_dumpable cuts::accept_cut cuts::i_binary_cut cuts::i_multi_cut cuts::not_cut cuts::random_cut cuts::reject_cut dpp::utils_cut genvtx::in_materials_vertex_validator genvtx::not_in_daughters_vertex_validator

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...
 

Detailed Description

The cut abstract base class (interface)

Member Enumeration Documentation

◆ export_config_flags

Flags for export to a container of properties.

Enumerator
EXPORT_CONFIG_CLEAR 
EXPORT_CONFIG_NAME 
EXPORT_CONFIG_DESCRIPTION 
EXPORT_CONFIG_VERSION 
EXPORT_CONFIG_LOGGING_PRIORITY 
EXPORT_CONFIG_DEFAULT 
EXPORT_CONFIG_LAST 

Constructor & Destructor Documentation

◆ i_cut()

cuts::i_cut::i_cut ( datatools::logger::priority  p = datatools::logger::PRIO_FATAL)
explicit

Constructor.

◆ ~i_cut()

virtual cuts::i_cut::~i_cut ( )
virtual

Destructor.

Member Function Documentation

◆ _accept()

virtual int cuts::i_cut::_accept ( )
protectedpure virtual

◆ _at_reset_user_data()

virtual void cuts::i_cut::_at_reset_user_data ( )
protectedvirtual

Hook executed when user data is reset.

Reimplemented in cuts::i_binary_cut, cuts::i_multi_cut, and cuts::not_cut.

◆ _at_set_user_data()

virtual void cuts::i_cut::_at_set_user_data ( )
protectedvirtual

Hook executed when user data is set.

Reimplemented in cuts::i_binary_cut, cuts::i_multi_cut, and cuts::not_cut.

◆ _common_initialize()

void cuts::i_cut::_common_initialize ( const datatools::properties a_config)
protected

Common initialization of all cuts.

◆ _export_user_data_to()

void cuts::i_cut::_export_user_data_to ( i_cut ) const
protected

Export user data to another cut.

◆ _finish_cut()

virtual int cuts::i_cut::_finish_cut ( int  a_selection_status)
protectedvirtual

Hook invoked after the main selection method.

See also
_accept ()

◆ _import_user_data_from()

void cuts::i_cut::_import_user_data_from ( const i_cut )
protected

Import user data from another cut.

◆ _increment_counters()

virtual void cuts::i_cut::_increment_counters ( int  a_selection_status)
protectedvirtual

Increment statistics counters.

◆ _prepare_cut()

virtual void cuts::i_cut::_prepare_cut ( )
protectedvirtual

Hook invoked before the main selection method.

See also
_accept ()

◆ _reset()

void cuts::i_cut::_reset ( )
protected

Reset the cut.

◆ _set_defaults()

void cuts::i_cut::_set_defaults ( )
protected

Set default attributes values.

◆ _set_initialized()

void cuts::i_cut::_set_initialized ( bool  a_initialized)
protected

Set the initialization flag.

◆ _set_name()

void cuts::i_cut::_set_name ( const std::string &  a_name)
protected

Set the cut name.

◆ _set_user_data()

void cuts::i_cut::_set_user_data ( const boost::shared_ptr< i_referenced_data > &  hd_)
protected

Set user data by shared pointer.

◆ common_ocd()

static void cuts::i_cut::common_ocd ( datatools::object_configuration_description ocd_)
static

Basic OCD support shared by all inherited modules.

◆ export_to_config()

virtual void cuts::i_cut::export_to_config ( datatools::properties config_,
uint32_t  flags_ = EXPORT_CONFIG_DEFAULT,
const std::string &  prefix_ = "" 
) const
virtual

Export to a container of properties.

Reimplemented in cuts::i_multi_cut, cuts::i_binary_cut, and cuts::not_cut.

◆ get_description()

const std::string& cuts::i_cut::get_description ( ) const

Return the description of the cut.

◆ get_logging_priority()

datatools::logger::priority cuts::i_cut::get_logging_priority ( ) const

Get the logging priority threshold.

◆ get_name()

const std::string& cuts::i_cut::get_name ( ) const

Return the name of the cut.

◆ get_number_of_accepted_entries()

size_t cuts::i_cut::get_number_of_accepted_entries ( ) const

Return the number of entries accepted by the cut.

◆ get_number_of_processed_entries()

size_t cuts::i_cut::get_number_of_processed_entries ( ) const

Return the total number of entries processed by the cut.

◆ get_number_of_rejected_entries()

size_t cuts::i_cut::get_number_of_rejected_entries ( ) const

Return the number of entries rejected by the cut.

◆ get_type_id()

virtual std::string cuts::i_cut::get_type_id ( ) const
pure virtual

Return the unique type identifier associated to the class of the cut object.

◆ get_user_data()

template<class T >
const T& cuts::i_cut::get_user_data ( ) const
inline

Get user data of given type.

◆ get_version()

const std::string& cuts::i_cut::get_version ( ) const

Return the version of the cut.

◆ has_description()

bool cuts::i_cut::has_description ( ) const

Check if the description of the cut is set.

◆ has_name()

bool cuts::i_cut::has_name ( ) const

Check if the name of the cut is set.

◆ has_user_data()

bool cuts::i_cut::has_user_data ( ) const

Check if some user data is referenced.

◆ has_version()

bool cuts::i_cut::has_version ( ) const

Check if the version of the cut is set.

◆ initialize()

virtual void cuts::i_cut::initialize ( const datatools::properties a_config,
datatools::service_manager a_service_manager,
cut_handle_dict_type a_cut_dictionary 
)
pure virtual

The main initialization method (post-construction)

Parameters
a_configthe container of configuration parameters
a_cut_dictionarya dictionary of existing 'cuts' which can be used to build the current cut (used in the framework of a factory)
a_service_managera 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.

◆ initialize_simple()

virtual void cuts::i_cut::initialize_simple ( )
virtual

Naked initialization method (default implementation,.

See also
initialize)

◆ initialize_standalone()

virtual void cuts::i_cut::initialize_standalone ( const datatools::properties a_config)
virtual

Initialization method through a container of configuration properties (default implementation,.

See also
initialize)

◆ initialize_with_service_only()

virtual void cuts::i_cut::initialize_with_service_only ( const datatools::properties a_config,
datatools::service_manager a_service_manager 
)
virtual

Initialization method through a container of configuration properties and a service manager (default implementation,

See also
initialize)

◆ initialize_without_service()

virtual void cuts::i_cut::initialize_without_service ( const datatools::properties a_config,
cut_handle_dict_type a_cut_dictionary 
)
virtual

Initialization method through a container of configuration properties and a dictionary of cuts (default implementation,

See also
initialize)

◆ is_activated_counters()

bool cuts::i_cut::is_activated_counters ( ) const

Check the flag to activate counters.

◆ is_debug()

bool cuts::i_cut::is_debug ( ) const

Check if logging priority is at least at debug level.

◆ is_initialized()

bool cuts::i_cut::is_initialized ( ) const

Check initialization status.

◆ is_user_data()

template<class T >
bool cuts::i_cut::is_user_data ( ) const
inline

Check user data type.

◆ is_user_data_type_supported() [1/2]

template<class T >
bool cuts::i_cut::is_user_data_type_supported ( ) const
inline

Check if data type is supported.

◆ is_user_data_type_supported() [2/2]

bool cuts::i_cut::is_user_data_type_supported ( const std::type_info &  tinfo_) const

Check if a data type is supported.

◆ operator()()

int cuts::i_cut::operator() ( )

Function interface for the selection method.

See also
process

◆ print()

void cuts::i_cut::print ( std::ostream &  a_out = std::clog) const

Print shortcut.

See also
tree_dump()

◆ process()

virtual int cuts::i_cut::process ( )
virtual

The main cut processing method

Returns
the selection status

◆ register_supported_user_data_type()

template<class T >
void cuts::i_cut::register_supported_user_data_type ( )
inline

Register user data type is supported.

◆ reset()

virtual void cuts::i_cut::reset ( )
pure virtual

◆ reset_counters()

void cuts::i_cut::reset_counters ( )

Reset the embedded counters.

◆ reset_user_data()

void cuts::i_cut::reset_user_data ( )

Clear the referenced user data.

◆ set_activated_counters()

void cuts::i_cut::set_activated_counters ( bool  )

Set the flag to activate statistics.

◆ set_description()

void cuts::i_cut::set_description ( const std::string &  a_description)

Set the description of the cut.

◆ set_logging_priority()

void cuts::i_cut::set_logging_priority ( datatools::logger::priority  p)

Set the logging priority threshold.

◆ set_name()

void cuts::i_cut::set_name ( const std::string &  a_name)

Set the name of the cut.

◆ set_user_data()

template<class T >
void cuts::i_cut::set_user_data ( const T &  obj_)
inline

Set user data.

◆ set_version()

void cuts::i_cut::set_version ( const std::string &  a_version)

Return the version of the cut.

◆ tree_dump()

virtual void cuts::i_cut::tree_dump ( std::ostream &  a_out = std::clog,
const std::string &  a_title = "",
const std::string &  a_indent = "",
bool  a_inherit = false 
) const
virtual

◆ unregister_supported_user_data_type()

template<class T >
void cuts::i_cut::unregister_supported_user_data_type ( )
inline

Unregister user data type is supported.

Member Data Documentation

◆ _description

std::string cuts::i_cut::_description
protected

The description of the cut.

◆ _logging

datatools::logger::priority cuts::i_cut::_logging
protected

Logging priority threshold.

◆ _name

std::string cuts::i_cut::_name
protected

The name of the cut.

◆ _supported_types_

std::set<const std::type_info *> cuts::i_cut::_supported_types_
protected

The set of supported user data types.

◆ _version

std::string cuts::i_cut::_version
protected

The version of the cut.


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