eformat::old::Header Class Reference

#include <Header.h>

Inheritance diagram for eformat::old::Header:

eformat::old::FullEventFragment eformat::old::ROBFragment eformat::old::ROSFragment eformat::old::SubDetectorFragment List of all members.

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

Private Attributes

const uint32_t * m_start
 < representation my start word

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 Header.h.


Constructor & Destructor Documentation

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:
it The exact position where this header should start.
match The word that this header should match.

Definition at line 21 of file Header24.cxx.

References EFORMAT_WRONG_MARKER, and marker().

00022   : m_start(it)
00023 {
00024   //get endiannesso
00025   uint32_t m = marker();
00026   if (m != match) throw EFORMAT_WRONG_MARKER(m, match);
00027 }

virtual eformat::old::Header::~Header (  )  [inline, virtual]

Destructor virtualisation

Definition at line 56 of file Header.h.

00056 {}


Member Function Documentation

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.

References EFORMAT_BAD_VERSION, EFORMAT_SIZE_CHECK, header_size_word(), eformat::MAJOR_OLD_VERSION, noffset(), nspecific(), nstatus(), and version().

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

00030 {
00031   if ( version() >> 16 != eformat::MAJOR_OLD_VERSION )
00032     throw EFORMAT_BAD_VERSION(version() >> 16, eformat::MAJOR_OLD_VERSION);
00033   if ( header_size_word() != (9 + nstatus() + noffset() + nspecific()) )
00034     throw EFORMAT_SIZE_CHECK(header_size_word(),
00035                              (9 + nstatus() + noffset() + nspecific()));
00036   return true;
00037 }

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:
n The fragment position, starting at zero, of the child fragment you would like to get.

Definition at line 39 of file Header24.cxx.

References EFORMAT_NO_SUCH_CHILD, m_start, noffset(), and offset().

Referenced by eformat::old::SubDetectorFragment::check_tree(), eformat::old::ROSFragment::check_tree(), eformat::old::ROBFragment::check_tree(), eformat::old::FullEventFragment::check_tree(), eformat::old::convert(), and eformat::old::ROBFragment::rod().

00040 {
00041   if (n >= noffset()) throw EFORMAT_NO_SUCH_CHILD(n, noffset());
00042   return &m_start[0xffffff & offset()[n]];
00043 }

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 Header.h.

References m_start.

Referenced by eformat::old::ROBFragment::check_tree(), and eformat::old::ROBFragment::rod().

00072 { return m_start[1]; }

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 Header.h.

References m_start.

Referenced by check(), eformat::old::ROBFragment::check_tree(), and eformat::old::ROBFragment::rod().

00078 { return m_start[2]; }

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

Returns the fragment type.

Definition at line 67 of file Header.h.

References m_start.

Referenced by Header().

00067 { return m_start[0]; }

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 Header.h.

References m_start, and nstatus().

Referenced by check(), eformat::old::SubDetectorFragment::check_tree(), eformat::old::ROSFragment::check_tree(), eformat::old::ROBFragment::check_tree(), eformat::old::FullEventFragment::check_tree(), child(), eformat::old::convert(), nspecific(), eformat::old::ROBFragment::rod(), and specific_header().

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

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 Header.h.

References m_start, noffset(), and nstatus().

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

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

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

Returns the number of status words available

Definition at line 98 of file Header.h.

References m_start.

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

00098 { return m_start[6]; }

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 Header.h.

References m_start, and nstatus().

Referenced by eformat::old::ROBFragment::check_tree(), child(), and eformat::old::ROBFragment::rod().

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

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

Returns the current run number.

Definition at line 93 of file Header.h.

References m_start.

Referenced by eformat::old::convert().

00093 { return m_start[5]; }

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

Returns the full source identifier.

Definition at line 88 of file Header.h.

References m_start.

Referenced by eformat::old::convert().

00088 { return m_start[4]; }

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 Header.h.

References m_start, noffset(), and nstatus().

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

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 Header.h.

References m_start.

Referenced by eformat::old::convert().

00104 { return &m_start[7]; }

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

Returns the formatting version.

Definition at line 83 of file Header.h.

References m_start.

Referenced by check().

00083 { return m_start[3]; }


Member Data Documentation

const uint32_t* eformat::old::Header::m_start [private]

< representation my start word

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

Definition at line 144 of file Header.h.

Referenced by child(), fragment_size_word(), header_size_word(), marker(), noffset(), nspecific(), nstatus(), offset(), run_no(), source_id(), specific_header(), status(), and version().


Generated on Tue Nov 29 23:36:30 2016 for BOSS_7.0.2 by  doxygen 1.4.7