15#ifndef EFORMAT_HEADER_H
16#define EFORMAT_HEADER_H
40 template <
class TPo
inter>
class Header {
51 Header (
const TPointer& it, uint32_t match);
76 { m_start = other.m_start;
return *
this; }
90 virtual bool check ()
const;
95 inline uint32_t
marker()
const {
return m_start[0]; }
111 inline uint32_t
version()
const {
return m_start[3]; }
116 inline uint32_t
source_id()
const {
return m_start[4]; }
121 inline uint32_t
nstatus ()
const {
return m_start[5]; }
128 inline void start (TPointer& it)
const { it = m_start; }
143 inline void end (TPointer& it)
const
157 inline void status (TPointer& it)
const { it = m_start; it += 6; }
173 { it = m_start; it += 7 +
nstatus(); }
188 virtual void child (TPointer& p,
size_t n)
const;
201 virtual void child_check (TPointer& p,
size_t n)
const;
213 virtual uint32_t
children (TPointer* p,
size_t max)
const;
223template <
class TPo
inter>
227 ERS_DEBUG_3(
"Building header 0x%x from iterator", match);
231 ERS_DEBUG_1(
"Initialized header with source identifier = %s",
238 ERS_DEBUG_3(
"Rebuilding header 0x%x from iterator", match);
240 if (marker() != match) {
243 ERS_DEBUG_1(
"Re-initialized header with source identifier = %s",
248template <
class TPo
inter>
251 ERS_DEBUG_2(
"Checking for consistency of fragment of type %s [%s]",
256 if ( header_size_word() != (7 + nstatus() + nspecific()) )
258 (7 + nstatus() + nspecific()));
262template <
class TPo
inter>
265 ERS_DEBUG_2(
"User asked for number of children of fragment type %s [%s]",
268 return children(0,0);
271template <
class TPo
inter>
274 ERS_DEBUG_2(
"User asked for child %ud of fragment type %s [%s]", n,
279 for (
size_t i=0; i<n; ++i) next += next[1];
284template <
class TPo
inter>
287 uint32_t total = nchildren();
292template <
class TPo
inter>
296 TPointer payload_start;
297 payload(payload_start);
300 payload_start, payload_size_word(), p,
max);
Exception thrown when versions do not match.
#define EFORMAT_BAD_VERSION(current, supported)
Exception thrown when the position of a child doesn't exist in the current fragment.
#define EFORMAT_NO_SUCH_CHILD(req, total)
When size checks do not match, this exception must be thrown.
#define EFORMAT_SIZE_CHECK(actual, informed)
Declares a type that can perform the conversion between source identifier components and the its 32-b...
Defines a helper class to encode and decode version numbers.
Defines the wrong-marker exception, to be used when the wrong marker is found on the event stream.
#define EFORMAT_WRONG_MARKER(current, expected)
When size checks do not match, this exception must be thrown.
#define EFORMAT_WRONG_SIZE(size)
ers header and documentation file
Defines a set of utilities common to many event operations.