#include <RODFragment.h>
Public Member Functions | |
RODFragment (const uint32_t *it, size_t size_word) | |
virtual | ~RODFragment () |
virtual bool | check () const |
uint32_t | marker () const |
uint32_t | fragment_size_word () const |
uint32_t | header_size_word () const |
uint32_t | trailer_size_word () const |
uint32_t | version () const |
uint32_t | source_id () const |
uint32_t | run_no () const |
uint32_t | lvl1_id () const |
uint32_t | bc_id () const |
uint32_t | lvl1_trigger_type () const |
uint32_t | detev_type () const |
uint32_t | nstatus () const |
const uint32_t * | status (void) const |
uint32_t | ndata () const |
const uint32_t * | data (void) const |
uint32_t | status_position () const |
Private Attributes | |
const uint32_t * | m_start |
my end word | |
size_t | m_size |
my total size, in number of words |
Definition at line 32 of file RODFragment.h.
eformat::old::RODFragment::RODFragment | ( | const uint32_t * | it, | |
size_t | size_word | |||
) |
To build a header given the containing buffer. I need to know where the header starts in order to do that.
it | The position pointing the first word of this fragment | |
size_word | The size of this fragment, in words |
Definition at line 22 of file RODFragment24.cxx.
References EFORMAT_WRONG_MARKER, marker(), and eformat::ROD.
00023 : m_start(it), 00024 m_size(size_word) 00025 { 00026 uint32_t m = marker(); 00027 if (m != eformat::ROD) throw EFORMAT_WRONG_MARKER(m, eformat::ROD); 00028 }
virtual eformat::old::RODFragment::~RODFragment | ( | ) | [inline, virtual] |
uint32_t eformat::old::RODFragment::bc_id | ( | ) | const [inline] |
Returns the bunch crossing identifier
Definition at line 99 of file RODFragment.h.
References m_start.
00099 { return m_start[6]; }
bool eformat::old::RODFragment::check | ( | ) | const [virtual] |
Says if the the header is valid. This may throw exceptions.
Definition at line 47 of file RODFragment24.cxx.
References EFORMAT_BAD_VERSION, EFORMAT_SIZE_CHECK, header_size_word(), m_size, eformat::MAJOR_OLD_VERSION, ndata(), nstatus(), and version().
Referenced by eformat::old::ROBFragment::check_tree(), and eformat::old::ROBFragment::rod().
00048 { 00049 if ( version() >> 16 != eformat::MAJOR_OLD_VERSION ) 00050 throw EFORMAT_BAD_VERSION(version() >> 16, eformat::MAJOR_OLD_VERSION); 00051 if ( header_size_word() != 9 ) 00052 throw EFORMAT_SIZE_CHECK(9, header_size_word()); 00053 if ( m_size != 12 + nstatus() + ndata() ) 00054 throw EFORMAT_SIZE_CHECK(m_size, (12 + nstatus() + ndata())); 00055 return true; 00056 }
const uint32_t * eformat::old::RODFragment::data | ( | void | ) | const |
Returns a pointer to the first data word
Definition at line 41 of file RODFragment24.cxx.
References m_start, nstatus(), eformat::STATUS_BACK, and status_position().
00042 { 00043 if (status_position() == eformat::STATUS_BACK) return &m_start[9]; 00044 return &m_start[9 + nstatus()]; 00045 }
uint32_t eformat::old::RODFragment::detev_type | ( | ) | const [inline] |
Returns the detector event type
Definition at line 109 of file RODFragment.h.
References m_start.
00109 { return m_start[8]; }
uint32_t eformat::old::RODFragment::fragment_size_word | ( | ) | const |
Returns the total fragment size
Definition at line 30 of file RODFragment24.cxx.
References header_size_word(), ndata(), nstatus(), and trailer_size_word().
00031 { 00032 return header_size_word() + trailer_size_word() + nstatus() + ndata(); 00033 }
uint32_t eformat::old::RODFragment::header_size_word | ( | ) | const [inline] |
Returns the size, in words, of the current header. That does not include the trailer.
Definition at line 69 of file RODFragment.h.
References m_start.
Referenced by check(), and fragment_size_word().
00069 { return m_start[1]; }
uint32_t eformat::old::RODFragment::lvl1_id | ( | ) | const [inline] |
Returns the lvl1 identifier
Definition at line 94 of file RODFragment.h.
References m_start.
00094 { return m_start[5]; }
uint32_t eformat::old::RODFragment::lvl1_trigger_type | ( | ) | const [inline] |
Returns the lvl1 trigger type
Definition at line 104 of file RODFragment.h.
References m_start.
00104 { return m_start[7]; }
uint32_t eformat::old::RODFragment::marker | ( | ) | const [inline] |
Returns the fragment type.
Definition at line 58 of file RODFragment.h.
References m_start.
Referenced by RODFragment().
00058 { return m_start[0]; }
uint32_t eformat::old::RODFragment::ndata | ( | ) | const [inline] |
Returns the number of data words available
Definition at line 125 of file RODFragment.h.
References m_size, and m_start.
Referenced by check(), fragment_size_word(), and status().
uint32_t eformat::old::RODFragment::nstatus | ( | ) | const [inline] |
Returns the number of status words available
Definition at line 114 of file RODFragment.h.
References m_size, and m_start.
Referenced by check(), data(), and fragment_size_word().
uint32_t eformat::old::RODFragment::run_no | ( | ) | const [inline] |
Returns the current run number.
Definition at line 89 of file RODFragment.h.
References m_start.
00089 { return m_start[4]; }
uint32_t eformat::old::RODFragment::source_id | ( | ) | const [inline] |
Returns the full source identifier.
Definition at line 84 of file RODFragment.h.
References m_start.
00084 { return m_start[3]; }
const uint32_t * eformat::old::RODFragment::status | ( | void | ) | const |
Returns the status words, as an iterator to the status words available.
Definition at line 35 of file RODFragment24.cxx.
References m_start, ndata(), eformat::STATUS_FRONT, and status_position().
00036 { 00037 if (status_position() == eformat::STATUS_FRONT) return &m_start[9]; 00038 return &m_start[9 + ndata()]; 00039 }
uint32_t eformat::old::RODFragment::status_position | ( | ) | const [inline] |
uint32_t eformat::old::RODFragment::trailer_size_word | ( | ) | const [inline] |
Returns the size, in words, of the trailer
Definition at line 74 of file RODFragment.h.
Referenced by fragment_size_word().
uint32_t eformat::old::RODFragment::version | ( | ) | const [inline] |
Returns the formatting version.
Definition at line 79 of file RODFragment.h.
References m_start.
Referenced by check().
00079 { return m_start[2]; }
size_t eformat::old::RODFragment::m_size [private] |
my total size, in number of words
Definition at line 142 of file RODFragment.h.
Referenced by check(), ndata(), nstatus(), and status_position().
const uint32_t* eformat::old::RODFragment::m_start [private] |
my end word
Definition at line 141 of file RODFragment.h.
Referenced by bc_id(), data(), detev_type(), header_size_word(), lvl1_id(), lvl1_trigger_type(), marker(), ndata(), nstatus(), run_no(), source_id(), status(), status_position(), and version().