BOSS 8.0.0
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:Andre.dos.Anjos@cern.ch">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/BadVersionIssue.h"
14#include "eformat/HeaderMarker.h"
15#include "eformat/SizeCheckIssue.h"
16#include "eformat/Status.h"
17#include "eformat/Version.h"
18#include "eformat/WrongMarkerIssue.h"
19#include "eformat/old/RODFragment.h"
20#include "eformat/util.h"
21
22eformat::old::RODFragment::RODFragment( const uint32_t* it, size_t size_word )
23 : m_start( it ), m_size( size_word ) {
24 uint32_t m = marker();
25 if ( m != eformat::ROD ) throw EFORMAT_WRONG_MARKER( m, eformat::ROD );
26}
27
31
32const uint32_t* eformat::old::RODFragment::status( void ) const {
33 if ( status_position() == eformat::STATUS_FRONT ) return &m_start[9];
34 return &m_start[9 + ndata()];
35}
36
37const uint32_t* eformat::old::RODFragment::data( void ) const {
38 if ( status_position() == eformat::STATUS_BACK ) return &m_start[9];
39 return &m_start[9 + nstatus()];
40}
41
43 if ( version() >> 16 != eformat::MAJOR_OLD_VERSION )
45 if ( header_size_word() != 9 ) throw EFORMAT_SIZE_CHECK( 9, header_size_word() );
46 if ( m_size != 12 + nstatus() + ndata() )
47 throw EFORMAT_SIZE_CHECK( m_size, ( 12 + nstatus() + ndata() ) );
48 return true;
49}
#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