BOSS 7.0.4
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
13#include "eformat/old/RODFragment.h"
14#include "eformat/util.h"
15#include "eformat/SizeCheckIssue.h"
16#include "eformat/BadVersionIssue.h"
17#include "eformat/WrongMarkerIssue.h"
18#include "eformat/HeaderMarker.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
#define EFORMAT_BAD_VERSION(current, supported)
#define EFORMAT_SIZE_CHECK(actual, informed)
#define EFORMAT_WRONG_MARKER(current, expected)
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
const uint32_t STATUS_BACK
status goes after data block