Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
Reader class for simulated data record. More...
#include <bayeux/mctools/simulated_data_reader.h>
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::properties & | get_run_header () const |
Get run header. More... | |
bool | has_run_footer () const |
Check if run footer exists. More... | |
const datatools::properties & | get_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_) |
Reader class for simulated data record.
mctools::simulated_data_reader::simulated_data_reader | ( | datatools::logger::priority | logging_ = datatools::logger::PRIO_FATAL | ) |
Constructor.
|
virtual |
Destructor.
|
protected |
|
protected |
|
protected |
|
protected |
bool mctools::simulated_data_reader::file_has_changed | ( | ) | const |
Check if the input file has changed after loading a simulated data record.
int mctools::simulated_data_reader::get_file_index | ( | ) | const |
Return the current input file index.
int mctools::simulated_data_reader::get_file_record_counter | ( | ) | const |
Return the current input file record counter.
datatools::logger::priority mctools::simulated_data_reader::get_logging_priority | ( | ) | const |
Get logging priority threshold.
int mctools::simulated_data_reader::get_max_files | ( | ) | const |
Get the maximum number of files to be used.
int mctools::simulated_data_reader::get_max_record_per_file | ( | ) | const |
Get the maximum number of simulated data records per file to be used.
int mctools::simulated_data_reader::get_max_record_total | ( | ) | const |
Get the maximum number of simulated data records to be used.
int mctools::simulated_data_reader::get_record_counter | ( | ) | const |
Return the record counter.
const datatools::properties& mctools::simulated_data_reader::get_run_footer | ( | ) | const |
Get footer header.
const datatools::properties& mctools::simulated_data_reader::get_run_header | ( | ) | const |
Get run header.
bool mctools::simulated_data_reader::has_next | ( | ) | const |
Check if the reader has next record.
bool mctools::simulated_data_reader::has_run_footer | ( | ) | const |
Check if run footer exists.
bool mctools::simulated_data_reader::has_run_header | ( | ) | const |
Check if run header exists.
void mctools::simulated_data_reader::initialize | ( | const std::string & | filename_ | ) |
Initialize the reader from an unique filename.
void mctools::simulated_data_reader::initialize | ( | const std::vector< std::string > & | filenames_ | ) |
Initialize the reader from a collection of filenames.
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.
void mctools::simulated_data_reader::initialize | ( | const datatools::properties & | setup_ | ) |
Initialize the reader from a list of parameters.
bool mctools::simulated_data_reader::is_initialized | ( | ) | const |
Check if reader is initialized.
bool mctools::simulated_data_reader::is_terminated | ( | ) | const |
Check if the reader is terminated.
int mctools::simulated_data_reader::load_next | ( | simulated_data & | sd_ | ) |
Load next reader.
void mctools::simulated_data_reader::reset | ( | ) |
Reset the reader.
void mctools::simulated_data_reader::set_filenames | ( | const datatools::properties & | setup_ | ) |
Set the input filenames.
void mctools::simulated_data_reader::set_logging_priority | ( | datatools::logger::priority | logging_ | ) |
Set logging priority threshold.
void mctools::simulated_data_reader::set_max_files | ( | int | max_files_ | ) |
Set the maximum number of files to be used.
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.
void mctools::simulated_data_reader::set_max_record_total | ( | int | max_record_total_ | ) |
Set the maximum number of simulated data records to be used.
|
virtual |
Smart print.
Reimplemented from datatools::i_tree_dumpable.