ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
offline_eformat::v40::Header Class Reference

Contains the information on the Header of a fragment as described by the original note. More...

#include <v40_Header.h>

Inheritance diagram for offline_eformat::v40::Header:
Collaboration diagram for offline_eformat::v40::Header:

Public Member Functions

 Header (const uint32_t *it)
 To build a header given the containing buffer. More...
 
 Header ()
 Builds an empty, otherwise useless Header. More...
 
 Header (const Header &other)
 Copy constructor. More...
 
virtual ~Header ()
 Destructor virtualisation. More...
 
Headeroperator= (const Header &other)
 Assigment operator. More...
 
void throws (bool b)
 If you set this parameter, objects of this type will throw exceptions. More...
 
bool throws () const
 Says if we are supposed to throw exceptions or not. More...
 
Headerassign (const uint32_t *it)
 Reassign this header. More...
 
uint32_t marker () const
 Returns the fragment type. More...
 
uint32_t fragment_size_word () const
 Returns the size, in words, of the current fragment. More...
 
uint32_t header_size_word () const
 Returns the size, in words, of the current header. More...
 
uint32_t version () const
 Returns the formatting version. More...
 
uint32_t source_id () const
 Returns the full source identifier. More...
 
uint32_t nstatus () const
 Returns the number of status words available. More...
 
const uint32_t * start () const
 Sets the pointer to my start. More...
 
void start (const uint32_t *&it) const
 
const uint32_t * payload () const
 Sets the pointer to where the payload starts. More...
 
void payload (const uint32_t *&it) const
 
const uint32_t * end () const
 Sets the pointer to one-past my end position. More...
 
void end (const uint32_t *&it) const
 
uint32_t payload_size_word (void) const
 Returns the payload size. More...
 
const uint32_t * status () const
 Returns the status words, as an iterator to the status words available. More...
 
void status (const uint32_t *&it) const
 
uint32_t checksum_type () const
 Returns the check-sum type entry. More...
 
uint32_t nspecific () const
 Returns the number of specific words available in the specific header part. More...
 
const uint32_t * specific_header () const
 Returns an iterator to the start of the specific header part. More...
 
void specific_header (const uint32_t *&it) const
 
uint32_t checksum_value (void) const
 Access the check sum value of this fragment, if any. More...
 
uint32_t eval_checksum (void) const
 Evaluates the current (supposed) checksum for this fragment, taking into consideration the current setting for the checksum type. More...
 
bool checksum (void) const
 This will actually re-calculate the checksum and verify that the payload of the current fragment matches that. More...
 

Private Attributes

const uint32_t * m_top
 < representation More...
 

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 37 of file v40_Header.h.

Constructor & Destructor Documentation

◆ Header() [1/3]

offline_eformat::v40::Header::Header ( const uint32_t *  it)

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.

Definition at line 15 of file v40_Header.cxx.

16  : m_top(it)
17 {
18 }

◆ Header() [2/3]

offline_eformat::v40::Header::Header ( )

Builds an empty, otherwise useless Header.

Definition at line 20 of file v40_Header.cxx.

21  : m_top()
22 {
23 }

◆ Header() [3/3]

offline_eformat::v40::Header::Header ( const Header other)

Copy constructor.

Parameters
otherThe other header to construct from

Definition at line 25 of file v40_Header.cxx.

26  : m_top(other.m_top)
27 {
28 }

◆ ~Header()

offline_eformat::v40::Header::~Header ( )
virtual

Destructor virtualisation.

Definition at line 30 of file v40_Header.cxx.

31 {
32 }

Member Function Documentation

◆ assign()

offline_eformat::v40::Header & offline_eformat::v40::Header::assign ( const uint32_t *  it)

Reassign this header.

Parameters
itThe exact position where this header should start.

Definition at line 117 of file v40_Header.cxx.

118 {
119  m_top = it;
120  return *this;
121 }

◆ checksum()

bool offline_eformat::v40::Header::checksum ( void  ) const

This will actually re-calculate the checksum and verify that the payload of the current fragment matches that.

Only works with contiguous memory templates.

Definition at line 128 of file v40_Header.cxx.

129 {
130  return (eval_checksum() == checksum_value());
131 }

◆ checksum_type()

uint32_t offline_eformat::v40::Header::checksum_type ( ) const

Returns the check-sum type entry.

Definition at line 97 of file v40_Header.cxx.

98 {
99  return m_top[6 + nstatus()];
100 }

◆ checksum_value()

uint32_t offline_eformat::v40::Header::checksum_value ( void  ) const

Access the check sum value of this fragment, if any.

Understand that if, checksum_type() resolves to eformat::NO_CHECKSUM, the returned value will have no meaning.

Definition at line 112 of file v40_Header.cxx.

113 {
114  return (checksum_type()?m_top[fragment_size_word()-1]:0);
115 }

◆ end() [1/2]

const uint32_t * offline_eformat::v40::Header::end ( ) const

Sets the pointer to one-past my end position.

Parameters
itThe pointer to set

Definition at line 82 of file v40_Header.cxx.

83 {
84  return m_top + fragment_size_word();
85 }

◆ end() [2/2]

void offline_eformat::v40::Header::end ( const uint32_t *&  it) const
inline

Definition at line 144 of file v40_Header.h.

144 { it = end(); } //legacy

◆ eval_checksum()

uint32_t offline_eformat::v40::Header::eval_checksum ( void  ) const

Evaluates the current (supposed) checksum for this fragment, taking into consideration the current setting for the checksum type.

Please note this value may be different from the actual checksum_value() if for any reason the fragment is corrupted.

Definition at line 123 of file v40_Header.cxx.

124 {
125  return eformat::helper::checksum(checksum_type(), payload(), payload_size_word());
126 }

◆ fragment_size_word()

uint32_t offline_eformat::v40::Header::fragment_size_word ( ) const

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

Definition at line 47 of file v40_Header.cxx.

48 {
49  return m_top[1];
50 }

◆ header_size_word()

uint32_t offline_eformat::v40::Header::header_size_word ( ) const

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

That does include the specific part of the header.

Definition at line 52 of file v40_Header.cxx.

53 {
54  return m_top[2];
55 }

◆ marker()

uint32_t offline_eformat::v40::Header::marker ( ) const

Returns the fragment type.

Definition at line 42 of file v40_Header.cxx.

43 {
44  return m_top[0];
45 }

◆ nspecific()

uint32_t offline_eformat::v40::Header::nspecific ( ) const

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

Definition at line 102 of file v40_Header.cxx.

103 {
104  return header_size_word() - ( 7 + nstatus() );
105 }

◆ nstatus()

uint32_t offline_eformat::v40::Header::nstatus ( ) const

Returns the number of status words available.

Definition at line 67 of file v40_Header.cxx.

68 {
69  return m_top[5];
70 }

◆ operator=()

offline_eformat::v40::Header & offline_eformat::v40::Header::operator= ( const Header other)

Assigment operator.

Parameters
otherThe other header to assign from

Definition at line 34 of file v40_Header.cxx.

35 {
36  if (this != &other) {
37  m_top = other.m_top;
38  }
39  return *this;
40 }

◆ payload() [1/2]

const uint32_t * offline_eformat::v40::Header::payload ( ) const

Sets the pointer to where the payload starts.

Parameters
itThe pointer to set

Definition at line 77 of file v40_Header.cxx.

78 {
79  return m_top + header_size_word();
80 }

◆ payload() [2/2]

void offline_eformat::v40::Header::payload ( const uint32_t *&  it) const
inline

Definition at line 136 of file v40_Header.h.

136 { it = payload(); } //legacy

◆ payload_size_word()

uint32_t offline_eformat::v40::Header::payload_size_word ( void  ) const

Returns the payload size.

Definition at line 87 of file v40_Header.cxx.

88 {
89  return fragment_size_word() - (header_size_word() + (checksum_type()?1:0));
90 }

◆ source_id()

uint32_t offline_eformat::v40::Header::source_id ( ) const

Returns the full source identifier.

Definition at line 62 of file v40_Header.cxx.

63 {
64  return m_top[4];
65 }

◆ specific_header() [1/2]

const uint32_t * offline_eformat::v40::Header::specific_header ( ) const

Returns an iterator to the start of the specific header part.

Parameters
itAn updateable iterator you should provide.

Definition at line 107 of file v40_Header.cxx.

108 {
109  return m_top + 7 + nstatus();
110 }

◆ specific_header() [2/2]

void offline_eformat::v40::Header::specific_header ( const uint32_t *&  it) const
inline

Definition at line 176 of file v40_Header.h.

177  { it = specific_header(); }

◆ start() [1/2]

const uint32_t * offline_eformat::v40::Header::start ( ) const

Sets the pointer to my start.

Parameters
itThe pointer to set

Definition at line 72 of file v40_Header.cxx.

73 {
74  return m_top;
75 }

◆ start() [2/2]

void offline_eformat::v40::Header::start ( const uint32_t *&  it) const
inline

Definition at line 128 of file v40_Header.h.

128 { it = start(); } //legacy

◆ status() [1/2]

const uint32_t * offline_eformat::v40::Header::status ( ) const

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

Parameters
itAn updateable iterator you should provide.

Definition at line 92 of file v40_Header.cxx.

93 {
94  return m_top + 6;
95 }

◆ status() [2/2]

void offline_eformat::v40::Header::status ( const uint32_t *&  it) const
inline

Definition at line 157 of file v40_Header.h.

157 { it = status(); } //legacy

◆ throws() [1/2]

bool offline_eformat::v40::Header::throws ( ) const

Says if we are supposed to throw exceptions or not.

◆ throws() [2/2]

void offline_eformat::v40::Header::throws ( bool  b)

If you set this parameter, objects of this type will throw exceptions.

The default behavior is to throw.

◆ version()

uint32_t offline_eformat::v40::Header::version ( ) const

Returns the formatting version.

Definition at line 57 of file v40_Header.cxx.

58 {
59  return m_top[3];
60 }

Member Data Documentation

◆ m_top

const uint32_t* offline_eformat::v40::Header::m_top
private

< representation

my start word

Definition at line 203 of file v40_Header.h.


The documentation for this class was generated from the following files:
offline_eformat::v40::Header::end
const uint32_t * end() const
Sets the pointer to one-past my end position.
Definition: v40_Header.cxx:82
offline_eformat::v40::Header::payload_size_word
uint32_t payload_size_word(void) const
Returns the payload size.
Definition: v40_Header.cxx:87
skel.it
it
Definition: skel.GENtoEVGEN.py:396
offline_eformat::v40::Header::header_size_word
uint32_t header_size_word() const
Returns the size, in words, of the current header.
Definition: v40_Header.cxx:52
offline_eformat::v40::Header::specific_header
const uint32_t * specific_header() const
Returns an iterator to the start of the specific header part.
Definition: v40_Header.cxx:107
offline_eformat::v40::Header::status
const uint32_t * status() const
Returns the status words, as an iterator to the status words available.
Definition: v40_Header.cxx:92
offline_eformat::v40::Header::m_top
const uint32_t * m_top
< representation
Definition: v40_Header.h:203
offline_eformat::v40::Header::payload
const uint32_t * payload() const
Sets the pointer to where the payload starts.
Definition: v40_Header.cxx:77
offline_eformat::v40::Header::checksum_type
uint32_t checksum_type() const
Returns the check-sum type entry.
Definition: v40_Header.cxx:97
offline_eformat::v40::Header::checksum_value
uint32_t checksum_value(void) const
Access the check sum value of this fragment, if any.
Definition: v40_Header.cxx:112
InDetDD::other
@ other
Definition: InDetDD_Defs.h:16
offline_eformat::v40::Header::eval_checksum
uint32_t eval_checksum(void) const
Evaluates the current (supposed) checksum for this fragment, taking into consideration the current se...
Definition: v40_Header.cxx:123
offline_eformat::v40::Header::start
const uint32_t * start() const
Sets the pointer to my start.
Definition: v40_Header.cxx:72
offline_eformat::v40::Header::fragment_size_word
uint32_t fragment_size_word() const
Returns the size, in words, of the current fragment.
Definition: v40_Header.cxx:47
offline_eformat::v40::Header::nstatus
uint32_t nstatus() const
Returns the number of status words available.
Definition: v40_Header.cxx:67