BOSS 7.1.2
BESIII Offline Software System
Loading...
Searching...
No Matches
eformat::old::Header Class Reference

#include <Header.h>

+ Inheritance diagram for eformat::old::Header:

Public Member Functions

 Header (const uint32_t *it, uint32_t match)
 
virtual ~Header ()
 
virtual bool check () const
 
uint32_t marker () const
 
uint32_t fragment_size_word () const
 
uint32_t header_size_word () const
 
uint32_t version () const
 
uint32_t source_id () const
 
uint32_t run_no () const
 
uint32_t nstatus () const
 
const uint32_t * status () const
 
uint32_t noffset () const
 
const uint32_t * offset (void) const
 
uint32_t nspecific () const
 
const uint32_t * specific_header (void) const
 
const uint32_t * child (size_t n) const
 

Detailed Description

Contains the information on the Header of a fragment as described by the original note. The header is a composite entity, build from two parts:

  1. The generic part, containing the header type, size and version information;
  2. The specific part, containing data that is specific for a particular fragment.

Definition at line 40 of file old/Header.h.

Constructor & Destructor Documentation

◆ Header()

eformat::old::Header::Header ( const uint32_t * it,
uint32_t match )

To build a header given the containing buffer. I need to know where the header starts in order to do that.

Parameters
itThe exact position where this header should start.
matchThe word that this header should match.

Definition at line 21 of file Header24.cxx.

22 : m_start(it)
23{
24 //get endiannesso
25 uint32_t m = marker();
26 if (m != match) throw EFORMAT_WRONG_MARKER(m, match);
27}
#define EFORMAT_WRONG_MARKER(current, expected)
uint32_t marker() const
Definition old/Header.h:67

◆ ~Header()

virtual eformat::old::Header::~Header ( )
inlinevirtual

Destructor virtualisation

Definition at line 56 of file old/Header.h.

56{}

Member Function Documentation

◆ check()

bool eformat::old::Header::check ( ) const
virtual

Says if the generic part of the header is valid. This may throw exceptions.

Reimplemented in eformat::old::FullEventFragment, eformat::old::ROBFragment, eformat::old::ROSFragment, and eformat::old::SubDetectorFragment.

Definition at line 29 of file Header24.cxx.

30{
31 if ( version() >> 16 != eformat::MAJOR_OLD_VERSION )
33 if ( header_size_word() != (9 + nstatus() + noffset() + nspecific()) )
35 (9 + nstatus() + noffset() + nspecific()));
36 return true;
37}
#define EFORMAT_BAD_VERSION(current, supported)
#define EFORMAT_SIZE_CHECK(actual, informed)
uint32_t version() const
Definition old/Header.h:83
uint32_t nstatus() const
Definition old/Header.h:98
uint32_t noffset() const
Definition old/Header.h:110
uint32_t nspecific() const
Definition old/Header.h:123
uint32_t header_size_word() const
Definition old/Header.h:78
const uint16_t MAJOR_OLD_VERSION
Definition Version.h:34

Referenced by eformat::old::FullEventFragment::check(), eformat::old::ROBFragment::check(), eformat::old::ROSFragment::check(), and eformat::old::SubDetectorFragment::check().

◆ child()

const uint32_t * eformat::old::Header::child ( size_t n) const

Returns the nth child fragment. If the nth fragment doesn't exist, an exception is thrown.

Parameters
nThe fragment position, starting at zero, of the child fragment you would like to get.

Definition at line 39 of file Header24.cxx.

40{
41 if (n >= noffset()) throw EFORMAT_NO_SUCH_CHILD(n, noffset());
42 return &m_start[0xffffff & offset()[n]];
43}
const Int_t n
#define EFORMAT_NO_SUCH_CHILD(req, total)
const uint32_t * offset(void) const
Definition old/Header.h:116

Referenced by eformat::old::convert(), and convert_ros().

◆ fragment_size_word()

uint32_t eformat::old::Header::fragment_size_word ( ) const
inline

Returns the size, in words, of the current fragment.

Definition at line 72 of file old/Header.h.

72{ return m_start[1]; }

◆ header_size_word()

uint32_t eformat::old::Header::header_size_word ( ) const
inline

Returns the size, in words, of the current header. That does include the specific part of the header.

Definition at line 78 of file old/Header.h.

78{ return m_start[2]; }

◆ marker()

uint32_t eformat::old::Header::marker ( ) const
inline

Returns the fragment type.

Definition at line 67 of file old/Header.h.

67{ return m_start[0]; }

Referenced by Header().

◆ noffset()

uint32_t eformat::old::Header::noffset ( ) const
inline

Returns the number of offset words available. This will also determine the number of child fragments available to this super-fragment.

Definition at line 110 of file old/Header.h.

110{ return m_start[7 + nstatus()]; }

Referenced by eformat::old::convert(), convert_ros(), nspecific(), and specific_header().

◆ nspecific()

uint32_t eformat::old::Header::nspecific ( ) const
inline

Returns the number of specific words available in the specific header part

Definition at line 123 of file old/Header.h.

124 { return m_start[8 + nstatus() + noffset()]; }

◆ nstatus()

uint32_t eformat::old::Header::nstatus ( ) const
inline

Returns the number of status words available

Definition at line 98 of file old/Header.h.

98{ return m_start[6]; }

Referenced by eformat::old::convert(), convert_ros(), noffset(), nspecific(), offset(), and specific_header().

◆ offset()

const uint32_t * eformat::old::Header::offset ( void ) const
inline

Returns the offset words, as an iterator to the offset words available.

Definition at line 116 of file old/Header.h.

117 { return &m_start[8 + nstatus()]; }

◆ run_no()

uint32_t eformat::old::Header::run_no ( ) const
inline

Returns the current run number.

Definition at line 93 of file old/Header.h.

93{ return m_start[5]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ source_id()

uint32_t eformat::old::Header::source_id ( ) const
inline

Returns the full source identifier.

Definition at line 88 of file old/Header.h.

88{ return m_start[4]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ specific_header()

const uint32_t * eformat::old::Header::specific_header ( void ) const
inline

Returns an iterator to the start of the specific header part (this includes the number of specific header fragments)

Definition at line 130 of file old/Header.h.

131 { return &m_start[9 + nstatus() + noffset()]; }

◆ status()

const uint32_t * eformat::old::Header::status ( ) const
inline

Returns the status words, as an iterator to the status words available.

Definition at line 104 of file old/Header.h.

104{ return &m_start[7]; }

Referenced by eformat::old::convert(), and convert_ros().

◆ version()

uint32_t eformat::old::Header::version ( ) const
inline

Returns the formatting version.

Definition at line 83 of file old/Header.h.

83{ return m_start[3]; }

Referenced by eformat::old::convert(), convert_ros(), and main().


The documentation for this class was generated from the following files: