Bayeux  3.4.1
Core Foundation library for SuperNEMO
Public Types | Public Member Functions | Protected Member Functions | List of all members
mctools::simulated_data_reader Class Reference

Reader class for simulated data record. More...

#include <bayeux/mctools/simulated_data_reader.h>

Inheritance diagram for mctools::simulated_data_reader:
datatools::i_tree_dumpable

Public Types

enum  load_status_type { LOAD_OK = 0, LOAD_ERROR = 1, LOAD_FATAL = 2 }
 Loading errors. 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

void set_max_files (int max_files_)
 Set the maximum number of files to be used. More...
 
void set_max_record_total (int max_record_total_)
 Set the maximum number of simulated data records to be used. More...
 
void set_max_record_per_file (int max_record_per_file_)
 Set the maximum number of simulated data records per file to be used. More...
 
int get_max_record_per_file () const
 Get the maximum number of simulated data records per file to be used. More...
 
int get_max_record_total () const
 Get the maximum number of simulated data records to be used. More...
 
int get_max_files () const
 Get the maximum number of files to be used. More...
 
void set_filenames (const datatools::properties &setup_)
 Set the input filenames. More...
 
datatools::logger::priority get_logging_priority () const
 Get logging priority threshold. More...
 
void set_logging_priority (datatools::logger::priority logging_)
 Set logging priority threshold. More...
 
 simulated_data_reader (datatools::logger::priority logging_=datatools::logger::PRIO_FATAL)
 Constructor. More...
 
virtual ~simulated_data_reader ()
 Destructor. More...
 
bool is_initialized () const
 Check if reader is initialized. More...
 
void initialize (const std::string &filename_)
 Initialize the reader from an unique filename. More...
 
void initialize (const std::vector< std::string > &filenames_)
 Initialize the reader from a collection of filenames. More...
 
void initialize (const std::string &path_, const std::string &prefix_, const std::string &extension_, unsigned int stop_, unsigned int start_=0, int increment_=1)
 Initialize the reader from a set of incremental filenames. More...
 
void initialize (const datatools::properties &setup_)
 Initialize the reader from a list of parameters. More...
 
void reset ()
 Reset the reader. More...
 
bool is_terminated () const
 Check if the reader is terminated. More...
 
bool has_next () const
 Check if the reader has next record. More...
 
int load_next (simulated_data &sd_)
 Load next reader. More...
 
bool has_run_header () const
 Check if run header exists. More...
 
const datatools::propertiesget_run_header () const
 Get run header. More...
 
bool has_run_footer () const
 Check if run footer exists. More...
 
const datatools::propertiesget_run_footer () const
 Get footer header. More...
 
bool file_has_changed () const
 Check if the input file has changed after loading a simulated data record. More...
 
int get_file_index () const
 Return the current input file index. More...
 
int get_file_record_counter () const
 Return the current input file record counter. More...
 
int get_record_counter () const
 Return the record counter. 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...
 
- 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

void _initialize ()
 
int _check_input ()
 
int _load (simulated_data &sd_)
 
void _set_defaults ()
 

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

Reader class for simulated data record.

Member Enumeration Documentation

◆ load_status_type

Loading errors.

Enumerator
LOAD_OK 
LOAD_ERROR 
LOAD_FATAL 

Constructor & Destructor Documentation

◆ simulated_data_reader()

mctools::simulated_data_reader::simulated_data_reader ( datatools::logger::priority  logging_ = datatools::logger::PRIO_FATAL)

Constructor.

◆ ~simulated_data_reader()

virtual mctools::simulated_data_reader::~simulated_data_reader ( )
virtual

Destructor.

Member Function Documentation

◆ _check_input()

int mctools::simulated_data_reader::_check_input ( )
protected

◆ _initialize()

void mctools::simulated_data_reader::_initialize ( )
protected

◆ _load()

int mctools::simulated_data_reader::_load ( simulated_data sd_)
protected

◆ _set_defaults()

void mctools::simulated_data_reader::_set_defaults ( )
protected

◆ file_has_changed()

bool mctools::simulated_data_reader::file_has_changed ( ) const

Check if the input file has changed after loading a simulated data record.

◆ get_file_index()

int mctools::simulated_data_reader::get_file_index ( ) const

Return the current input file index.

◆ get_file_record_counter()

int mctools::simulated_data_reader::get_file_record_counter ( ) const

Return the current input file record counter.

◆ get_logging_priority()

datatools::logger::priority mctools::simulated_data_reader::get_logging_priority ( ) const

Get logging priority threshold.

◆ get_max_files()

int mctools::simulated_data_reader::get_max_files ( ) const

Get the maximum number of files to be used.

◆ get_max_record_per_file()

int mctools::simulated_data_reader::get_max_record_per_file ( ) const

Get the maximum number of simulated data records per file to be used.

◆ get_max_record_total()

int mctools::simulated_data_reader::get_max_record_total ( ) const

Get the maximum number of simulated data records to be used.

◆ get_record_counter()

int mctools::simulated_data_reader::get_record_counter ( ) const

Return the record counter.

◆ get_run_footer()

const datatools::properties& mctools::simulated_data_reader::get_run_footer ( ) const

Get footer header.

◆ get_run_header()

const datatools::properties& mctools::simulated_data_reader::get_run_header ( ) const

Get run header.

◆ has_next()

bool mctools::simulated_data_reader::has_next ( ) const

Check if the reader has next record.

◆ has_run_footer()

bool mctools::simulated_data_reader::has_run_footer ( ) const

Check if run footer exists.

◆ has_run_header()

bool mctools::simulated_data_reader::has_run_header ( ) const

Check if run header exists.

◆ initialize() [1/4]

void mctools::simulated_data_reader::initialize ( const std::string &  filename_)

Initialize the reader from an unique filename.

◆ initialize() [2/4]

void mctools::simulated_data_reader::initialize ( const std::vector< std::string > &  filenames_)

Initialize the reader from a collection of filenames.

◆ initialize() [3/4]

void mctools::simulated_data_reader::initialize ( const std::string &  path_,
const std::string &  prefix_,
const std::string &  extension_,
unsigned int  stop_,
unsigned int  start_ = 0,
int  increment_ = 1 
)

Initialize the reader from a set of incremental filenames.

◆ initialize() [4/4]

void mctools::simulated_data_reader::initialize ( const datatools::properties setup_)

Initialize the reader from a list of parameters.

◆ is_initialized()

bool mctools::simulated_data_reader::is_initialized ( ) const

Check if reader is initialized.

◆ is_terminated()

bool mctools::simulated_data_reader::is_terminated ( ) const

Check if the reader is terminated.

◆ load_next()

int mctools::simulated_data_reader::load_next ( simulated_data sd_)

Load next reader.

◆ reset()

void mctools::simulated_data_reader::reset ( )

Reset the reader.

◆ set_filenames()

void mctools::simulated_data_reader::set_filenames ( const datatools::properties setup_)

Set the input filenames.

◆ set_logging_priority()

void mctools::simulated_data_reader::set_logging_priority ( datatools::logger::priority  logging_)

Set logging priority threshold.

◆ set_max_files()

void mctools::simulated_data_reader::set_max_files ( int  max_files_)

Set the maximum number of files to be used.

◆ set_max_record_per_file()

void mctools::simulated_data_reader::set_max_record_per_file ( int  max_record_per_file_)

Set the maximum number of simulated data records per file to be used.

◆ set_max_record_total()

void mctools::simulated_data_reader::set_max_record_total ( int  max_record_total_)

Set the maximum number of simulated data records to be used.

◆ tree_dump()

virtual void mctools::simulated_data_reader::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.


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