Bayeux
3.4.1
Core Foundation library for SuperNEMO
|
The brio generic reader class. More...
#include <bayeux/brio/reader.h>
Public Member Functions | |
reader () | |
Default constructor. More... | |
reader (const std::string &filename_, datatools::logger::priority p_=datatools::logger::PRIO_FATAL) | |
Constructor. More... | |
reader (const std::string &filename_, const std::string &format_str_, datatools::logger::priority p_=datatools::logger::PRIO_FATAL) | |
Constructor. More... | |
virtual | ~reader () |
Destructor. More... | |
void | set_check_serial_tag (bool new_value_=true) |
bool | is_check_serial_tag () const |
void | rewind_store (const std::string &label_="") |
void | unwind_store (const std::string &label_="") |
bool | has_previous (const std::string &label_="") const |
bool | has_next (const std::string &label_="") const |
template<typename T > | |
int | load_next (T &data_, const std::string &label_="") |
Load template method for next entry. More... | |
template<typename T > | |
int | load_previous (T &data_, const std::string &label_="") |
Load template method for previous entry. More... | |
template<typename T > | |
int | load (T &data_, int64_t nentry_=-1) |
Load template method for arbitrary entry. More... | |
template<typename T > | |
int | load (T &data_, const std::string &label_, int64_t nentry_=-1) |
Load template method for arbitrary store and entry. 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_info (std::ostream &out_=std::clog) const |
Print. More... | |
Public Member Functions inherited from brio::detail::base_io | |
base_io (int rw_) | |
base_io (int rw_, datatools::logger::priority p_) | |
base_io (int rw_, int format_, datatools::logger::priority p_) | |
virtual | ~base_io () |
virtual void | open (const std::string &filename_) |
File open. More... | |
virtual void | close () |
File close. More... | |
virtual bool | is_opened () const |
bool | is_reading () const |
bool | is_writing () const |
bool | is_format_pba () const |
bool | is_format_text () const |
int | get_format () const |
void | set_format (int format_) |
void | set_format (const std::string &format_str_) |
bool | is_debug () const |
void | set_debug (bool) |
bool | is_verbose () const |
void | set_verbose (bool) |
int64_t | get_number_of_entries (const std::string &label_="") const |
int64_t | get_current_entry (const std::string &label_="") const |
const std::string & | get_serialization_tag (const std::string &label_="") const |
bool | has_store (const std::string &label_) const |
bool | has_store_with_serial_tag (const std::string &label_, const std::string &serial_tag_) const |
template<class T > | |
bool | has_store_with_matching_serial_tag (const std::string &label_) const |
bool | has_mixed_store (const std::string &label_) const |
void | select_store (const std::string &label_) |
bool | has_automatic_store () const |
void | select_automatic_store () |
void | unselect_store () |
void | get_list_of_stores (std::list< std::string > &list_) const |
void | reset () |
void | set_logging_priority (datatools::logger::priority) |
datatools::logger::priority | get_logging_priority () const |
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 | |
virtual void | _at_open (const std::string &filename_) |
template<class T > | |
int | _at_load (T &data_, store_info *ptr_si_, int64_t nentry_) |
void | _set_default () |
Protected Member Functions inherited from brio::detail::base_io | |
void | _set_default () |
void | _reset () |
store_info * | _get_store_info (const std::string &label_="") |
const store_info * | _get_store_info (const std::string &label_="") const |
Additional Inherited Members | |
Public Types inherited from brio::detail::base_io | |
enum | format_type { FORMAT_UNDEFINED = 0, FORMAT_PBA = 1, FORMAT_TEXT = 2 } |
Label for Boost portable text archive. More... | |
enum | rw_type { RW_UNDEFINED = 0, RW_READ = 1, RW_WRITE = 2 } |
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 brio::detail::base_io | |
static const std::string & | pba_label () |
static const std::string & | text_label () |
Label for Boost portable binary archive. More... | |
static int | get_format (const std::string &format_str_) |
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 brio::detail::base_io | |
std::string | _filename |
Name of the current I/O file (extensions are .brio or .trio) More... | |
TFile * | _file |
Handle to the current embedded ROOT file. More... | |
store_info_dict_type | _store_infos |
Dictionnary of stores. More... | |
store_info * | _current_store |
Handle to the current active store (if any) More... | |
int | _rw |
Read/write mode tag. More... | |
std::locale * | _default_locale |
Default I/O locale (for portable streams) More... | |
std::locale * | _locale |
I/O locale (for portable streams) More... | |
The brio generic reader class.
brio::reader::reader | ( | ) |
Default constructor.
brio::reader::reader | ( | const std::string & | filename_, |
datatools::logger::priority | p_ = datatools::logger::PRIO_FATAL |
||
) |
Constructor.
brio::reader::reader | ( | const std::string & | filename_, |
const std::string & | format_str_, | ||
datatools::logger::priority | p_ = datatools::logger::PRIO_FATAL |
||
) |
Constructor.
|
virtual |
Destructor.
|
protected |
|
protectedvirtual |
Implements brio::detail::base_io.
|
protected |
bool brio::reader::has_next | ( | const std::string & | label_ = "" | ) | const |
Check if some next entry exists relatively to the current entry
bool brio::reader::has_previous | ( | const std::string & | label_ = "" | ) | const |
Check if some previous entry exists relatively to the current entry
bool brio::reader::is_check_serial_tag | ( | ) | const |
int brio::reader::load | ( | T & | data_, |
int64_t | nentry_ = -1 |
||
) |
Load template method for arbitrary entry.
int brio::reader::load | ( | T & | data_, |
const std::string & | label_, | ||
int64_t | nentry_ = -1 |
||
) |
Load template method for arbitrary store and entry.
int brio::reader::load_next | ( | T & | data_, |
const std::string & | label_ = "" |
||
) |
Load template method for next entry.
int brio::reader::load_previous | ( | T & | data_, |
const std::string & | label_ = "" |
||
) |
Load template method for previous entry.
void brio::reader::print_info | ( | std::ostream & | out_ = std::clog | ) | const |
Print.
void brio::reader::rewind_store | ( | const std::string & | label_ = "" | ) |
Position current entry of store 'label' just before the first serialized object
void brio::reader::set_check_serial_tag | ( | bool | new_value_ = true | ) |
By default, serialization tag are checked each time an object is deserialized. This behaviour can be changed:
brio::reader a_reader; a_reader.open("file.root"); a_reader.set_check_serial_tag(false);
|
virtual |
Smart print.
Reimplemented from brio::detail::base_io.
void brio::reader::unwind_store | ( | const std::string & | label_ = "" | ) |
Position current entry of store 'label' just after the last serialized object