Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Member Functions | Protected Member Functions | List of all members
dpp::input_module Class Reference

An input data processing module for automated I/O operations. More...

#include <bayeux/dpp/input_module.h>

Inheritance diagram for dpp::input_module:
dpp::base_module datatools::i_tree_dumpable

Public Member Functions

void set_limits (int max_record_total_, int max_record_per_file_=0, int max_files_=-1)
 Set limits. More...
 
void set_single_input_file (const std::string &filepath_)
 Set the filename of a single input file. More...
 
void set_list_of_input_files (const std::vector< std::string > &filepaths_, bool allow_duplicate_=false)
 Set the filenames of a list of input files. More...
 
void set_incremental_input_files (const std::string &path_, const std::string &prefix_, const std::string &extension_, unsigned int stop_, unsigned int start_=0, int increment_=1)
 Set the incremented filenames of input files. More...
 
void set_context_label (const std::string &)
 Set the label/name of the context service to be used. More...
 
void import_context_metadata (const std::string &)
 Import a metadata section with given label from the input stream to the context service. More...
 
void set_import_context_all (bool)
 Import all metadata sections from the input stream to the context service. More...
 
 input_module (datatools::logger::priority=datatools::logger::PRIO_FATAL)
 Constructor. More...
 
virtual ~input_module ()
 Destructor. More...
 
virtual void initialize (const ::datatools::properties &, datatools::service_manager &, dpp::module_handle_dict_type &)
 Initialization. More...
 
virtual void reset ()
 Reset. More...
 
virtual process_status process (::datatools::things &)
 Data record processing. 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...
 
bool is_terminated () const
 Check input termination. More...
 
const io_commonget_common () const
 Return a reference to the non mutable internal I/O data structure. More...
 
bool has_metadata_store () const
 Check if an embedded metadata store exists. More...
 
void set_clear_record (bool)
 Set clear record flag. More...
 
bool is_clear_record () const
 Check the Set clear record flag. More...
 
const datatools::multi_propertiesget_metadata_store () const
 Return a const reference to the existing embedded metadata store. More...
 
void clear_metadata_store ()
 Clear the embedded metadata store. More...
 
bool metadata_was_updated () const
 Check is metadata has been possibly updated after last data record processing. More...
 
bool has_source () const
 Check source. More...
 
const i_data_sourceget_source () const
 Get source. More...
 
- Public Member Functions inherited from dpp::base_module
 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
 
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
 

Protected Member Functions

process_status _load (datatools::things &a_data_record)
 Load a data record. More...
 
process_status _open_source ()
 Open the data record source. More...
 
void _check_limits ()
 Check the limits on input file(s) More...
 
void _set_defaults ()
 Set default values before explicit settings and initialization. More...
 
io_common_grab_common ()
 Return a reference to the mutable internal I/O data structure. More...
 
- Protected Member Functions inherited from dpp::base_module
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...
 

Additional Inherited Members

- Public Types inherited from dpp::base_module
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...
 
- Static Public Member Functions inherited from dpp::base_module
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 Attributes inherited from dpp::base_module
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

An input data processing module for automated I/O operations.

Constructor & Destructor Documentation

◆ input_module()

dpp::input_module::input_module ( datatools::logger::priority  = datatools::logger::PRIO_FATAL)

Constructor.

◆ ~input_module()

virtual dpp::input_module::~input_module ( )
virtual

Destructor.

Member Function Documentation

◆ _check_limits()

void dpp::input_module::_check_limits ( )
protected

Check the limits on input file(s)

◆ _grab_common()

io_common& dpp::input_module::_grab_common ( )
protected

Return a reference to the mutable internal I/O data structure.

◆ _load()

process_status dpp::input_module::_load ( datatools::things a_data_record)
protected

Load a data record.

◆ _open_source()

process_status dpp::input_module::_open_source ( )
protected

Open the data record source.

◆ _set_defaults()

void dpp::input_module::_set_defaults ( )
protected

Set default values before explicit settings and initialization.

◆ clear_metadata_store()

void dpp::input_module::clear_metadata_store ( )

Clear the embedded metadata store.

◆ get_common()

const io_common& dpp::input_module::get_common ( ) const

Return a reference to the non mutable internal I/O data structure.

◆ get_metadata_store()

const datatools::multi_properties& dpp::input_module::get_metadata_store ( ) const

Return a const reference to the existing embedded metadata store.

◆ get_source()

const i_data_source& dpp::input_module::get_source ( ) const

Get source.

◆ has_metadata_store()

bool dpp::input_module::has_metadata_store ( ) const

Check if an embedded metadata store exists.

◆ has_source()

bool dpp::input_module::has_source ( ) const

Check source.

◆ import_context_metadata()

void dpp::input_module::import_context_metadata ( const std::string &  )

Import a metadata section with given label from the input stream to the context service.

◆ initialize()

virtual void dpp::input_module::initialize ( const ::datatools::properties ,
datatools::service_manager ,
dpp::module_handle_dict_type  
)
virtual

Initialization.

◆ is_clear_record()

bool dpp::input_module::is_clear_record ( ) const

Check the Set clear record flag.

◆ is_terminated()

bool dpp::input_module::is_terminated ( ) const

Check input termination.

◆ metadata_was_updated()

bool dpp::input_module::metadata_was_updated ( ) const

Check is metadata has been possibly updated after last data record processing.

◆ process()

virtual process_status dpp::input_module::process ( ::datatools::things )
virtual

Data record processing.

◆ reset()

virtual void dpp::input_module::reset ( )
virtual

Reset.

Implements dpp::base_module.

◆ set_clear_record()

void dpp::input_module::set_clear_record ( bool  )

Set clear record flag.

◆ set_context_label()

void dpp::input_module::set_context_label ( const std::string &  )

Set the label/name of the context service to be used.

◆ set_import_context_all()

void dpp::input_module::set_import_context_all ( bool  )

Import all metadata sections from the input stream to the context service.

◆ set_incremental_input_files()

void dpp::input_module::set_incremental_input_files ( const std::string &  path_,
const std::string &  prefix_,
const std::string &  extension_,
unsigned int  stop_,
unsigned int  start_ = 0,
int  increment_ = 1 
)

Set the incremented filenames of input files.

◆ set_limits()

void dpp::input_module::set_limits ( int  max_record_total_,
int  max_record_per_file_ = 0,
int  max_files_ = -1 
)

Set limits.

◆ set_list_of_input_files()

void dpp::input_module::set_list_of_input_files ( const std::vector< std::string > &  filepaths_,
bool  allow_duplicate_ = false 
)

Set the filenames of a list of input files.

◆ set_single_input_file()

void dpp::input_module::set_single_input_file ( const std::string &  filepath_)

Set the filename of a single input file.

◆ tree_dump()

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

Smart print.

Reimplemented from dpp::base_module.


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