BOSS 7.0.9
BESIII Offline Software System
Loading...
Searching...
No Matches
RODFragment24.cxx
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file old/RODFragment.cxx
5 * @author <a href="mailto:[email protected]">Andre DOS ANJOS</a>
6 * $Author: zhangy $
7 * $Revision: 1.1.1.1 $
8 * $Date: 2009/06/19 07:35:41 $
9 *
10 * Implements the old (v2.4) ROD fragment class
11 */
12
14#include "eformat/util.h"
19#include "eformat/Version.h"
20#include "eformat/Status.h"
21
22eformat::old::RODFragment::RODFragment (const uint32_t* it, size_t size_word)
23 : m_start(it),
24 m_size(size_word)
25{
26 uint32_t m = marker();
28}
29
31{
32 return header_size_word() + trailer_size_word() + nstatus() + ndata();
33}
34
35const uint32_t* eformat::old::RODFragment::status (void) const
36{
37 if (status_position() == eformat::STATUS_FRONT) return &m_start[9];
38 return &m_start[9 + ndata()];
39}
40
41const uint32_t* eformat::old::RODFragment::data (void) const
42{
43 if (status_position() == eformat::STATUS_BACK) return &m_start[9];
44 return &m_start[9 + nstatus()];
45}
46
48{
49 if ( version() >> 16 != eformat::MAJOR_OLD_VERSION )
50 throw EFORMAT_BAD_VERSION(version() >> 16, eformat::MAJOR_OLD_VERSION);
51 if ( header_size_word() != 9 )
52 throw EFORMAT_SIZE_CHECK(9, header_size_word());
53 if ( m_size != 12 + nstatus() + ndata() )
54 throw EFORMAT_SIZE_CHECK(m_size, (12 + nstatus() + ndata()));
55 return true;
56}
57
58
59
60
Exception thrown when versions do not match.
#define EFORMAT_BAD_VERSION(current, supported)
Defines the constants used by Event Fragments.
Definition of the ROD header entity, following the description of the Event Format note,...
When size checks do not match, this exception must be thrown.
#define EFORMAT_SIZE_CHECK(actual, informed)
A helper class to help the user to interpret the status information in the first status word and to c...
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)
uint32_t marker() const
Definition: RODFragment.h:58
const uint32_t * status(void) const
virtual bool check() const
const uint32_t * data(void) const
uint32_t fragment_size_word() const
RODFragment(const uint32_t *it, size_t size_word)
const uint32_t STATUS_FRONT
status goes in front of data block
Definition: Status.h:38
@ ROD
The ROD marker.
Definition: HeaderMarker.h:26
const uint16_t MAJOR_OLD_VERSION
Definition: Version.h:34
const uint32_t STATUS_BACK
status goes after data block
Definition: Status.h:39
Defines a set of utilities common to many event operations.