ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
BitField Class Reference

#include <ZdcWordDecoder.h>

Collaboration diagram for BitField:

Public Member Functions

 BitField (const std::string &name, uint8_t begin, uint8_t size)
 
template<typename T >
get (const uint32_t &word) const
 

Static Public Member Functions

template<typename T >
static T get (const uint32_t &word, uint8_t offset, uint8_t size)
 
static uint32_t mask (uint32_t word, uint8_t offset, uint32_t mask)
 

Private Attributes

std::string m_name
 
uint32_t m_mask
 
uint8_t m_shift
 

Detailed Description

Definition at line 14 of file ZdcWordDecoder.h.

Constructor & Destructor Documentation

◆ BitField()

BitField::BitField ( const std::string &  name,
uint8_t  begin,
uint8_t  size 
)

Definition at line 11 of file ZdcWordDecoder.cxx.

11  :
12  m_name(name) {
13  m_shift = begin;
14  m_mask = (1 << size) - 1;
15 }

Member Function Documentation

◆ get() [1/2]

template<typename T >
T BitField::get ( const uint32_t &  word) const
inline

Definition at line 22 of file ZdcWordDecoder.h.

22  {
23  return T((word >> m_shift) & m_mask);
24  }

◆ get() [2/2]

template<typename T >
static T BitField::get ( const uint32_t &  word,
uint8_t  offset,
uint8_t  size 
)
inlinestatic

Definition at line 26 of file ZdcWordDecoder.h.

26  {
27  return T((word >> offset) & ((1 << size) - 1));
28  }

◆ mask()

static uint32_t BitField::mask ( uint32_t  word,
uint8_t  offset,
uint32_t  mask 
)
inlinestatic

Definition at line 30 of file ZdcWordDecoder.h.

30  {
31  return (word >> offset) & mask;
32  }

Member Data Documentation

◆ m_mask

uint32_t BitField::m_mask
private

Definition at line 17 of file ZdcWordDecoder.h.

◆ m_name

std::string BitField::m_name
private

Definition at line 16 of file ZdcWordDecoder.h.

◆ m_shift

uint8_t BitField::m_shift
private

Definition at line 18 of file ZdcWordDecoder.h.


The documentation for this class was generated from the following files:
BitField::m_name
std::string m_name
Definition: ZdcWordDecoder.h:16
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
BitField::mask
static uint32_t mask(uint32_t word, uint8_t offset, uint32_t mask)
Definition: ZdcWordDecoder.h:30
BitField::m_mask
uint32_t m_mask
Definition: ZdcWordDecoder.h:17
convertTimingResiduals.offset
offset
Definition: convertTimingResiduals.py:71
TSU::T
unsigned long long T
Definition: L1TopoDataTypes.h:35
BitField::m_shift
uint8_t m_shift
Definition: ZdcWordDecoder.h:18