BOSS 7.0.4
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"
14#include "eformat/HeaderMarker.h"
15#include "eformat/Version.h"
16#include "eformat/SizeCheckIssue.h"
17#include "eformat/BadVersionIssue.h"
18#include "eformat/WrongMarkerIssue.h"
19#include "eformat/NoSuchChildIssue.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
const Int_t n
#define EFORMAT_BAD_VERSION(current, supported)
#define EFORMAT_SIZE_CHECK(actual, informed)
#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