BOSS 6.6.4.p03
BESIII Offline Software System
Loading...
Searching...
No Matches
Header24.cxx
Go to the documentation of this file.
1//Dear emacs, this is -*- c++ -*-
2
3/**
4 * @file old/Header.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 Header class
11 */
12
13#include "eformat/old/Header.h"
15#include "eformat/Version.h"
20
21eformat::old::Header::Header (const uint32_t* it, uint32_t match)
22 : m_start(it)
23{
24 //get endiannesso
25 uint32_t m = marker();
26 if (m != match) throw EFORMAT_WRONG_MARKER(m, match);
27}
28
30{
31 if ( version() >> 16 != eformat::MAJOR_OLD_VERSION )
32 throw EFORMAT_BAD_VERSION(version() >> 16, eformat::MAJOR_OLD_VERSION);
33 if ( header_size_word() != (9 + nstatus() + noffset() + nspecific()) )
34 throw EFORMAT_SIZE_CHECK(header_size_word(),
35 (9 + nstatus() + noffset() + nspecific()));
36 return true;
37}
38
39const uint32_t* eformat::old::Header::child (size_t n) const
40{
41 if (n >= noffset()) throw EFORMAT_NO_SUCH_CHILD(n, noffset());
42 return &m_start[0xffffff & offset()[n]];
43}
44
45
46
47
Exception thrown when versions do not match.
#define EFORMAT_BAD_VERSION(current, supported)
const Int_t n
Defines the constants used by Event Fragments.
Exception thrown when the position of a child doesn't exist in the current fragment.
#define EFORMAT_NO_SUCH_CHILD(req, total)
When size checks do not match, this exception must be thrown.
#define EFORMAT_SIZE_CHECK(actual, informed)
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)
virtual bool check() const
Definition: Header24.cxx:29
Header(const uint32_t *it, uint32_t match)
Definition: Header24.cxx:21
const uint32_t * child(size_t n) const
Definition: Header24.cxx:39
uint32_t marker() const
Definition: old/Header.h:67
const uint16_t MAJOR_OLD_VERSION
Definition: Version.h:34
Defines the Header entity. The definition is based on the update of ATL-DAQ-98-129,...