22 #ifndef BRIO_WRITER_INL_H 23 #define BRIO_WRITER_INL_H 28 #pragma clang diagnostic push 29 #pragma clang diagnostic ignored "-Wc++11-long-long" 31 #pragma clang diagnostic ignored "-Wshadow" 34 #pragma GCC diagnostic push 36 #pragma GCC diagnostic ignored "-Wshadow" 40 #pragma GCC diagnostic pop 43 #pragma clang diagnostic pop 53 "Operation prohibited; file is not opened !");
60 "No target store is selected nor target !");
62 data_.get_serial_tag(),
65 ptr_si = this->
_add_store(label_, data_.get_serial_tag(),
72 "Could not determine any store to save data !");
74 "ptr_si = " << std::hex << ptr_si << std::dec);
76 "Using store with label '" << ptr_si->
label <<
"'...");
78 ptr_si->
tree->Print ();
80 return this->_at_store<T>(data_, ptr_si);
98 "Serialization tag mismatch ! " 99 <<
"Attempt to store an object with `" 100 << data_.get_serial_tag ()
101 <<
"' serialization tag " 102 <<
"in the store labelled '" 104 <<
"' with dedicated `" 106 <<
"' serialization tag !");
111 typedef std::vector<char> buffer_type;
117 if (!ptr_si->
buffer.empty()) {
119 }
else if (ptr_si->
buffer.capacity() == 0) {
126 namespace io = boost::iostreams;
127 io::stream<io::back_insert_device<buffer_type> > output_stream(ptr_si->
buffer);
130 datatools::portable_oarchive oa(output_stream);
135 boost::archive::text_oarchive oa(output_stream);
138 output_stream.flush();
145 <<
" buffer capacity = " 146 << ptr_si->
buffer.capacity());
153 ptr_si->
tree->Fill ();
168 #endif // BRIO_READER_INL_H store_info * _get_store_info(const std::string &label_="")
store_info * _add_store(const std::string &label_, const std::string &serial_tag_, size_t buffer_size_)
const std::string & get_serialization_tag() const
static const std::string & automatic_store_label()
std::vector< char > buffer
the input buffer (used only by the writer)
Definition: utils.h:81
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
int _at_store(const T &dat, store_info *store_info_)
Definition: writer-inl.h:84
static size_t default_store_buffer_size()
TArrayCMod fDataBuffer
The buffer of bytes that contains the Boost archive associated to the serialized data.
Definition: brio_record.h:50
datatools::logger::priority get_logging_priority() const
TString fSerialTag
The serialization tag of the data class.
Definition: brio_record.h:48
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
#define DT_LOG_DEBUG(Priority, Message)
Log Message if Priority is greater or equal to PRIO_DEBUG.
Definition: logger_macros.h:147
static const std::string & postponed_dedicated_serial_tag_label()
UInt_t fVersionTag
The serialization version number of the data class.
Definition: brio_record.h:49
std::string label
the label (name) of the store
Definition: utils.h:75
bool is_format_pba() const
int64_t number_of_entries
the number of entries in the store
Definition: utils.h:82
std::string serialization_tag
the serialization tag associated to the object stored in the store
Definition: utils.h:76
static size_t default_stream_buffer_size()
brio_record record
the current brio record to be (de)serialized
Definition: utils.h:79
bool has_dedicated_serialization_tag() const
#define DT_THROW_IF(Condition, ExceptionType, Message)
Definition: exception.h:76
#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
int store(const T &data_, const std::string &label_="")
Definition: writer-inl.h:49
bool is_format_text() const
Top-level namespace of the Bayeux/brio module library.
Definition: base_io.h:37