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

The brio generic reader class. More...

#include <bayeux/brio/reader.h>

Inheritance diagram for brio::reader:
brio::detail::base_io datatools::i_tree_dumpable

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...
 

Detailed Description

The brio generic reader class.

Constructor & Destructor Documentation

◆ reader() [1/3]

brio::reader::reader ( )

Default constructor.

◆ reader() [2/3]

brio::reader::reader ( const std::string &  filename_,
datatools::logger::priority  p_ = datatools::logger::PRIO_FATAL 
)

Constructor.

◆ reader() [3/3]

brio::reader::reader ( const std::string &  filename_,
const std::string &  format_str_,
datatools::logger::priority  p_ = datatools::logger::PRIO_FATAL 
)

Constructor.

◆ ~reader()

virtual brio::reader::~reader ( )
virtual

Destructor.

Member Function Documentation

◆ _at_load()

template<class T >
int brio::reader::_at_load ( T &  data_,
store_info ptr_si_,
int64_t  nentry_ 
)
protected

◆ _at_open()

virtual void brio::reader::_at_open ( const std::string &  filename_)
protectedvirtual

Implements brio::detail::base_io.

◆ _set_default()

void brio::reader::_set_default ( )
protected

◆ has_next()

bool brio::reader::has_next ( const std::string &  label_ = "") const

Check if some next entry exists relatively to the current entry

◆ has_previous()

bool brio::reader::has_previous ( const std::string &  label_ = "") const

Check if some previous entry exists relatively to the current entry

◆ is_check_serial_tag()

bool brio::reader::is_check_serial_tag ( ) const

◆ load() [1/2]

template<typename T >
int brio::reader::load ( T &  data_,
int64_t  nentry_ = -1 
)

Load template method for arbitrary entry.

◆ load() [2/2]

template<typename T >
int brio::reader::load ( T &  data_,
const std::string &  label_,
int64_t  nentry_ = -1 
)

Load template method for arbitrary store and entry.

◆ load_next()

template<typename T >
int brio::reader::load_next ( T &  data_,
const std::string &  label_ = "" 
)

Load template method for next entry.

◆ load_previous()

template<typename T >
int brio::reader::load_previous ( T &  data_,
const std::string &  label_ = "" 
)

Load template method for previous entry.

◆ print_info()

void brio::reader::print_info ( std::ostream &  out_ = std::clog) const

Print.

◆ rewind_store()

void brio::reader::rewind_store ( const std::string &  label_ = "")

Position current entry of store 'label' just before the first serialized object

◆ set_check_serial_tag()

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);

◆ tree_dump()

virtual void brio::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 brio::detail::base_io.

◆ unwind_store()

void brio::reader::unwind_store ( const std::string &  label_ = "")

Position current entry of store 'label' just after the last serialized object


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