22 #ifndef BRIO_READER_INL_H 23 #define BRIO_READER_INL_H 28 #pragma clang diagnostic push 29 #pragma clang diagnostic ignored "-Wc++11-long-long" 33 #pragma clang diagnostic pop 42 return this->load<T>(data_, label_, entry + 1);
49 return this->load<T>(data_, label_, entry - 1);
55 return this->load<T>(data_,
"", nentry_);
59 int reader::load(T & data_,
const std::string & label_, int64_t nentry_)
63 "Operation prohibited; file is not opened !");
69 "No source store with label '" << label_ <<
"' !");
73 "No source store is selected nor default store is available !");
74 ptr_si = _automatic_store_;
76 return this->_at_load<T>(data_, ptr_si, nentry_);
85 if (_check_serial_tag_) {
93 "Data serialization tag '" << data_.get_serial_tag()
100 "Source store '" << si.
label <<
"' has no entry !");
101 int64_t nentry = nentry_;
106 "Source store '" << si.
label <<
"' has " 107 <<
"no serialized entry at index '" << nentry_ <<
"' !");
122 int ret = si.
tree->GetEntry(nentry, 1);
127 << nentry <<
"' at entry # " << nentry
128 <<
" in source store labelled '" << si.
label.c_str()
129 <<
"' from file '" <<
_filename <<
"' !");
130 }
else if (ret == -1) {
133 "An I/O error occurs from entry '" 135 <<
"' in source store labelled '" << si.
label.c_str()
136 <<
"' from file '" <<
_filename <<
"' !");
141 if (_check_serial_tag_) {
154 <<
"' in (mixed) source store labelled '" << si.
label.c_str()
157 <<
"' does not match the requested '" 158 << data_.get_serial_tag() <<
"' data type !");
163 boost::iostreams::stream<boost::iostreams::array_source>
167 datatools::portable_iarchive ia(input_stream);
172 boost::archive::text_iarchive ia(input_stream);
183 #endif // BRIO_READER_INL_H store_info * _get_store_info(const std::string &label_="")
const std::string & get_serialization_tag() const
A class that contains internal dynamic informations for a given store.
Definition: utils.h:33
TTree * tree
the embedded ROOT tree
Definition: utils.h:78
TArrayCMod fDataBuffer
The buffer of bytes that contains the Boost archive associated to the serialized data.
Definition: brio_record.h:50
int load(T &data_, int64_t nentry_=-1)
Load template method for arbitrary entry.
Definition: reader-inl.h:53
datatools::logger::priority get_logging_priority() const
TString fSerialTag
The serialization tag of the data class.
Definition: brio_record.h:48
void reset()
Reset the internal data.
int64_t current_entry
the current entry number in the store
Definition: utils.h:83
virtual bool is_opened() const
store_info * _current_store
Handle to the current active store (if any)
Definition: base_io.h:156
std::string label
the label (name) of the store
Definition: utils.h:75
int load_next(T &data_, const std::string &label_="")
Load template method for next entry.
Definition: reader-inl.h:39
bool is_format_pba() const
int64_t number_of_entries
the number of entries in the store
Definition: utils.h:82
brio_record record
the current brio record to be (de)serialized
Definition: utils.h:79
bool has_dedicated_serialization_tag() const
int _at_load(T &data_, store_info *ptr_si_, int64_t nentry_)
Definition: reader-inl.h:80
#define DT_THROW_IF(Condition, ExceptionType, Message)
Definition: exception.h:76
int load_previous(T &data_, const std::string &label_="")
Load template method for previous entry.
Definition: reader-inl.h:46
std::string _filename
Name of the current I/O file (extensions are .brio or .trio)
Definition: base_io.h:153
#define DT_LOG_TRACE(Priority, Message)
Log Message if Priority is greater or equal to PRIO_TRACE.
Definition: logger_macros.h:227
Char_t * fArray
Array of bytes.
Definition: TArrayCMod.h:31
std::locale * _locale
I/O locale (for portable streams)
Definition: base_io.h:159
int64_t get_current_entry(const std::string &label_="") const
bool is_format_text() const
Top-level namespace of the Bayeux/brio module library.
Definition: base_io.h:37