ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
ZdcByteStreamReadV1V2Tool::BitReader Class Reference
Collaboration diagram for ZdcByteStreamReadV1V2Tool::BitReader:

Public Member Functions

 BitReader (const std::vector< uint32_t > &ppBlock)
 
uint32_t getField (const uint8_t numBits)
 

Private Attributes

uint32_t m_ppPointer {}
 
uint32_t m_ppMaxBit {}
 
const std::vector< uint32_t > & m_ppBlock
 

Detailed Description

Definition at line 77 of file ZdcByteStreamReadV1V2Tool.h.

Constructor & Destructor Documentation

◆ BitReader()

ZdcByteStreamReadV1V2Tool::BitReader::BitReader ( const std::vector< uint32_t > &  ppBlock)
inline

Definition at line 80 of file ZdcByteStreamReadV1V2Tool.h.

81  : m_ppPointer (0),
82  m_ppMaxBit (31 * ppBlock.size()),
83  m_ppBlock (ppBlock)
84  {
85  }

Member Function Documentation

◆ getField()

uint32_t ZdcByteStreamReadV1V2Tool::BitReader::getField ( const uint8_t  numBits)

Definition at line 1113 of file ZdcByteStreamReadV1V2Tool.cxx.

1115 {
1116  if ((m_ppPointer + numBits) <= m_ppMaxBit) {
1117  uint32_t iWord = m_ppPointer / 31;
1118  uint8_t iBit = m_ppPointer % 31;
1119  m_ppPointer += numBits;
1120 
1121  uint32_t result;
1122  if ((iBit + numBits) <= 31) {
1123  result = ::bitFieldSize(m_ppBlock[iWord], iBit, numBits);
1124  } else {
1125  uint8_t nb1 = 31 - iBit;
1126  uint8_t nb2 = numBits - nb1;
1127  uint32_t field1 = ::bitFieldSize(m_ppBlock[iWord], iBit, nb1);
1128  uint32_t field2 = ::bitFieldSize(m_ppBlock[iWord + 1], 0, nb2);
1129  result = field1 | (field2 << nb1);
1130  }
1131 
1132  return result;
1133  }
1134 
1135  throw std::out_of_range("Requested too much bits from ppm block");
1136 }

Member Data Documentation

◆ m_ppBlock

const std::vector<uint32_t>& ZdcByteStreamReadV1V2Tool::BitReader::m_ppBlock
private

Definition at line 93 of file ZdcByteStreamReadV1V2Tool.h.

◆ m_ppMaxBit

uint32_t ZdcByteStreamReadV1V2Tool::BitReader::m_ppMaxBit {}
private

Definition at line 92 of file ZdcByteStreamReadV1V2Tool.h.

◆ m_ppPointer

uint32_t ZdcByteStreamReadV1V2Tool::BitReader::m_ppPointer {}
private

Definition at line 91 of file ZdcByteStreamReadV1V2Tool.h.


The documentation for this class was generated from the following files:
get_generator_info.result
result
Definition: get_generator_info.py:21
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ZdcByteStreamReadV1V2Tool::BitReader::m_ppPointer
uint32_t m_ppPointer
Definition: ZdcByteStreamReadV1V2Tool.h:91
ZdcByteStreamReadV1V2Tool::BitReader::m_ppBlock
const std::vector< uint32_t > & m_ppBlock
Definition: ZdcByteStreamReadV1V2Tool.h:93
ZdcByteStreamReadV1V2Tool::BitReader::m_ppMaxBit
uint32_t m_ppMaxBit
Definition: ZdcByteStreamReadV1V2Tool.h:92