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

Base processing module (abstract interface) More...

#include <bayeux/dpp/base_module.h>

Inheritance diagram for dpp::base_module:
datatools::i_tree_dumpable dpp::chain_module dpp::dummy_module dpp::dump_module dpp::if_module dpp::input_module dpp::output_module dpp::skip_module dpp::utils_module mctools::g4::simulation_module mctools::simulated_data_input_module

Public Types

enum  process_status {
  PROCESS_OK = 0, PROCESS_SUCCESS = PROCESS_OK, PROCESS_CONTINUE = PROCESS_OK, PROCESS_ERROR = datatools::bit_mask::bit00,
  PROCESS_FAILURE = PROCESS_ERROR, PROCESS_STOP = datatools::bit_mask::bit01, PROCESS_ERROR_STOP = PROCESS_ERROR | PROCESS_STOP, PROCESS_FATAL = datatools::bit_mask::bit02,
  PROCESS_INVALID = datatools::bit_mask::bit31
}
 Processing status flags used as the returned value of data processing methods through the pipeline. 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_module (datatools::logger::priority p_=datatools::logger::PRIO_FATAL)
 Default constructor : More...
 
virtual ~base_module ()
 Destructor : More...
 
bool has_name () const
 Check the module name. More...
 
void set_name (const std::string &)
 Set the module name. More...
 
const std::string & get_name () const
 Return the module name. More...
 
bool has_description () const
 Check the module description. More...
 
const std::string & get_description () const
 Return the module description. More...
 
void set_description (const std::string &description_)
 Set the module description. More...
 
bool has_last_error_message () const
 Check the module last error message. More...
 
void set_last_error_message (const std::string &)
 Set the module last error message. More...
 
void append_last_error_message (const std::string &errmsg_)
 Append an error message. More...
 
void reset_last_error_message ()
 Reset the module last error message. More...
 
const std::string & get_last_error_message () const
 Return the module last error message. More...
 
bool is_initialized () const
 Check initialization flag. More...
 
virtual void initialize_simple ()
 Initialize the module without external resource. More...
 
virtual void initialize_simple_with_service (datatools::service_manager &service_manager_)
 Initialize the module with a service manager only. More...
 
virtual void initialize_standalone (const datatools::properties &config_)
 Initialize the module only using a set of parameters. More...
 
virtual void initialize_with_service (const datatools::properties &config_, datatools::service_manager &service_manager_)
 Initialize the module using a set of parameters and a service manager. More...
 
virtual void initialize_without_service (const datatools::properties &config, module_handle_dict_type &module_dictionnary_)
 Initialize the module using a set of parameters and a map of modules. More...
 
virtual void initialize (const datatools::properties &config_, datatools::service_manager &service_manager_, module_handle_dict_type &module_dictionary_)=0
 
virtual process_status process (datatools::things &data_model_)=0
 
virtual void reset ()=0
 The main termination method. 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...
 
void print (std::ostream &out_=std::clog) const
 Default print. More...
 
void set_logging_priority (datatools::logger::priority p_)
 Set logging priority. More...
 
datatools::logger::priority get_logging_priority () const
 Returns logging priority. 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

void _set_name (const std::string &name_)
 Set the name of the module. More...
 
void _set_initialized (bool initialized_)
 Set the initialization flag of the module. More...
 
void _common_initialize (const datatools::properties &config_)
 Basic initialization shared by all inherited modules. More...
 

Protected Attributes

std::string _name
 The name of the module. More...
 
std::string _description
 The description of the module. More...
 
datatools::logger::priority _logging
 The logging priority threshold. More...
 
bool _initialized
 The initialization flag. More...
 
std::string _last_error_message
 Last error message (questionable) More...
 

Detailed Description

Base processing module (abstract interface)

Member Enumeration Documentation

◆ process_status

Processing status flags used as the returned value of data processing methods through the pipeline.

Enumerator
PROCESS_OK 
PROCESS_SUCCESS 

Module has processed normally and processing can go on

PROCESS_CONTINUE 

idem PROCESS_OK

PROCESS_ERROR 

idem PROCESS_OK

PROCESS_FAILURE 

Module has met an error (considered as non critical)

PROCESS_STOP 

idem PROCESS_ERROR

PROCESS_ERROR_STOP 

Module asks for the stop of the processing of the current data record in the current pipeline branch

PROCESS_FATAL 

Module asks for the stop of the processing of the current data record in the current pipeline branch because of some error

PROCESS_INVALID 

Module has met an error and requests a total abortion of the processing session

Constructor & Destructor Documentation

◆ base_module()

dpp::base_module::base_module ( datatools::logger::priority  p_ = datatools::logger::PRIO_FATAL)

Default constructor :

◆ ~base_module()

virtual dpp::base_module::~base_module ( )
virtual

Destructor :

Member Function Documentation

◆ _common_initialize()

void dpp::base_module::_common_initialize ( const datatools::properties config_)
protected

Basic initialization shared by all inherited modules.

◆ _set_initialized()

void dpp::base_module::_set_initialized ( bool  initialized_)
protected

Set the initialization flag of the module.

◆ _set_name()

void dpp::base_module::_set_name ( const std::string &  name_)
protected

Set the name of the module.

◆ append_last_error_message()

void dpp::base_module::append_last_error_message ( const std::string &  errmsg_)

Append an error message.

◆ common_ocd()

static void dpp::base_module::common_ocd ( datatools::object_configuration_description ocd_)
static

Basic OCD support shared by all inherited modules.

◆ get_description()

const std::string& dpp::base_module::get_description ( ) const

Return the module description.

◆ get_last_error_message()

const std::string& dpp::base_module::get_last_error_message ( ) const

Return the module last error message.

◆ get_logging_priority()

datatools::logger::priority dpp::base_module::get_logging_priority ( ) const

Returns logging priority.

◆ get_name()

const std::string& dpp::base_module::get_name ( ) const

Return the module name.

◆ has_description()

bool dpp::base_module::has_description ( ) const

Check the module description.

◆ has_last_error_message()

bool dpp::base_module::has_last_error_message ( ) const

Check the module last error message.

◆ has_name()

bool dpp::base_module::has_name ( ) const

Check the module name.

◆ initialize()

virtual void dpp::base_module::initialize ( const datatools::properties config_,
datatools::service_manager service_manager_,
module_handle_dict_type module_dictionary_ 
)
pure virtual

The main initialization method (post-construction):

Parameters
config_the container of configuration parameters
service_manager_a manager for external services
module_dictionary_a dictionnary of existing 'modules' which can be used to build the current module (used in the framework of a factory)

Implemented in dpp::dummy_module, mctools::g4::simulation_module, and mctools::simulated_data_input_module.

◆ initialize_simple()

virtual void dpp::base_module::initialize_simple ( )
virtual

Initialize the module without external resource.

◆ initialize_simple_with_service()

virtual void dpp::base_module::initialize_simple_with_service ( datatools::service_manager service_manager_)
virtual

Initialize the module with a service manager only.

◆ initialize_standalone()

virtual void dpp::base_module::initialize_standalone ( const datatools::properties config_)
virtual

Initialize the module only using a set of parameters.

◆ initialize_with_service()

virtual void dpp::base_module::initialize_with_service ( const datatools::properties config_,
datatools::service_manager service_manager_ 
)
virtual

Initialize the module using a set of parameters and a service manager.

◆ initialize_without_service()

virtual void dpp::base_module::initialize_without_service ( const datatools::properties config,
module_handle_dict_type module_dictionnary_ 
)
virtual

Initialize the module using a set of parameters and a map of modules.

◆ is_initialized()

bool dpp::base_module::is_initialized ( ) const

Check initialization flag.

◆ print()

void dpp::base_module::print ( std::ostream &  out_ = std::clog) const

Default print.

◆ process()

virtual process_status dpp::base_module::process ( datatools::things data_model_)
pure virtual

The main data model processing method

Parameters
data_model_the data model to be processed
Returns
the status code (0=ok)

Implemented in dpp::dummy_module, mctools::g4::simulation_module, and mctools::simulated_data_input_module.

◆ reset()

virtual void dpp::base_module::reset ( )
pure virtual

◆ reset_last_error_message()

void dpp::base_module::reset_last_error_message ( )

Reset the module last error message.

◆ set_description()

void dpp::base_module::set_description ( const std::string &  description_)

Set the module description.

◆ set_last_error_message()

void dpp::base_module::set_last_error_message ( const std::string &  )

Set the module last error message.

◆ set_logging_priority()

void dpp::base_module::set_logging_priority ( datatools::logger::priority  p_)

Set logging priority.

◆ set_name()

void dpp::base_module::set_name ( const std::string &  )

Set the module name.

◆ tree_dump()

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

Member Data Documentation

◆ _description

std::string dpp::base_module::_description
protected

The description of the module.

◆ _initialized

bool dpp::base_module::_initialized
protected

The initialization flag.

◆ _last_error_message

std::string dpp::base_module::_last_error_message
protected

Last error message (questionable)

◆ _logging

datatools::logger::priority dpp::base_module::_logging
protected

The logging priority threshold.

◆ _name

std::string dpp::base_module::_name
protected

The name of the module.


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