Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
A simple event identifier based on a run number and an event number Run and event numbers are represented by 32 bits signed integrals. The event_id class is serializable through the Boost.Serialization library. Utilities for standard I/O streams is also provided. More...
#include <bayeux/datatools/event_id.h>
Public Member Functions | |
event_id () | |
The default constructor. More... | |
event_id (int e_) | |
A constructor that sets only the event number. More... | |
event_id (int r_, int e_) | |
A constructor to fully set the event_id object. More... | |
virtual | ~event_id () |
The destructor. More... | |
virtual void | clear () |
Invalidate the id. More... | |
void | reset () |
Invalidate the id. More... | |
int | get_run_number () const |
Returns the run number. More... | |
int | get_event_number () const |
Returns the event number. More... | |
void | set_run_number (int r_) |
Set the run number. More... | |
void | set_event_number (int e_) |
Set the event number. More... | |
void | set (int r_, int e_) |
Set the run and event numbers. More... | |
bool | is_valid () const |
Check whether the ID is valid. More... | |
bool | is_complete () const |
Check whether the ID is complete (run number and event number are set). More... | |
bool | has (int r_, int e_) const |
Check if the instance has specific run and event numbers. More... | |
bool | match (int r_, int e_) const |
Check if the instance match specific run and event numbers. More... | |
bool | operator== (const event_id &id_) const |
Comparison operator. More... | |
bool | operator< (const event_id &id_) const |
Comparison operator. More... | |
bool | operator> (const event_id &id_) const |
Comparison operator. More... | |
std::string | to_string () const |
Output convertor. More... | |
void | from_string (const std::string &s_) |
Input convertor. More... | |
virtual void | tree_dump (std::ostream &out_=std::cerr, const std::string &title_="", const std::string &indent_="", bool inherit_=false) const |
Method for smart printing (from the datatools::i_tree_dump interface). More... | |
void | smart_print (std::ostream &out_, const std::string &title_, const std::string &indent_) const |
std::string | to_smart_string (const std::string &title_, const std::string &indent_) const |
void | dump () const |
Shortcut to the tree_dump method with default arguments. More... | |
Public Member Functions inherited from datatools::i_serializable | |
i_serializable () | |
Default constructor. More... | |
virtual | ~i_serializable () |
Destructor. More... | |
virtual const std::string & | get_serial_tag () const =0 |
Return the serialization string identifier of the class. 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 |
Public Member Functions inherited from datatools::i_clear | |
virtual | ~i_clear () |
Destructor. More... | |
Static Public Attributes | |
static const int | INVALID_RUN_NUMBER = -1 |
Constant value for an invalid run number. More... | |
static const int | ANY_RUN_NUMBER = -2 |
Constant value for any run number. More... | |
static const int | INVALID_EVENT_NUMBER = -1 |
Constant value for an invalid event number. More... | |
static const int | ANY_EVENT_NUMBER = -2 |
Constant value for any event number. More... | |
static const char | IO_FORMAT_SEP = '_' |
Separator character used in to_string and from_string methods. More... | |
static const char | IO_FORMAT_ANY = '*' |
static const char | IO_FORMAT_INVALID = '!' |
Friends | |
std::ostream & | operator<< (std::ostream &s_, const event_id &id_) |
Output operator. More... | |
std::istream & | operator>> (std::istream &s_, event_id &id_) |
Input operator. More... | |
Additional Inherited Members | |
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 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_) |
A simple event identifier based on a run number and an event number Run and event numbers are represented by 32 bits signed integrals. The event_id class is serializable through the Boost.Serialization library. Utilities for standard I/O streams is also provided.
Example :
datatools::event_id::event_id | ( | ) |
The default constructor.
Initialized to an invalid id.
|
explicit |
A constructor that sets only the event number.
datatools::event_id::event_id | ( | int | r_, |
int | e_ | ||
) |
A constructor to fully set the event_id object.
r_ | the run number. |
e_ | the event number. |
|
virtual |
The destructor.
|
virtual |
Invalidate the id.
Implements datatools::i_clear.
void datatools::event_id::dump | ( | ) | const |
Shortcut to the tree_dump method with default arguments.
void datatools::event_id::from_string | ( | const std::string & | s_ | ) |
Input convertor.
int datatools::event_id::get_event_number | ( | ) | const |
Returns the event number.
int datatools::event_id::get_run_number | ( | ) | const |
Returns the run number.
bool datatools::event_id::has | ( | int | r_, |
int | e_ | ||
) | const |
Check if the instance has specific run and event numbers.
r_ | the run number. |
e_ | the event number. |
bool datatools::event_id::is_complete | ( | ) | const |
Check whether the ID is complete (run number and event number are set).
bool datatools::event_id::is_valid | ( | ) | const |
Check whether the ID is valid.
bool datatools::event_id::match | ( | int | r_, |
int | e_ | ||
) | const |
Check if the instance match specific run and event numbers.
r_ | the run number. |
e_ | the event number. |
void datatools::event_id::reset | ( | ) |
Invalidate the id.
void datatools::event_id::set | ( | int | r_, |
int | e_ | ||
) |
Set the run and event numbers.
r_ | the run number. |
e_ | the event number. |
void datatools::event_id::set_event_number | ( | int | e_ | ) |
Set the event number.
e_ | the event number. |
void datatools::event_id::set_run_number | ( | int | r_ | ) |
Set the run number.
r_ | the run number. |
void datatools::event_id::smart_print | ( | std::ostream & | out_, |
const std::string & | title_, | ||
const std::string & | indent_ | ||
) | const |
std::string datatools::event_id::to_smart_string | ( | const std::string & | title_, |
const std::string & | indent_ | ||
) | const |
std::string datatools::event_id::to_string | ( | ) | const |
Output convertor.
|
virtual |
Method for smart printing (from the datatools::i_tree_dump interface).
out_ | the output stream |
title_ | the title to be displayed |
indent_ | the indentation string |
inherit_ | the inheritance flag. |
Reimplemented from datatools::i_tree_dumpable.
|
friend |
Input operator.
|
static |
Constant value for any event number.
|
static |
Constant value for any run number.
|
static |
Constant value for an invalid event number.
|
static |
Constant value for an invalid run number.
|
static |
|
static |
|
static |
Separator character used in to_string and from_string methods.