ATLAS Offline Software
Loading...
Searching...
No Matches
LVL1BS::BitField Class Reference

#include <WordDecoder.h>

Collaboration diagram for LVL1BS::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 WordDecoder.h.

Constructor & Destructor Documentation

◆ BitField()

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

Member Function Documentation

◆ get() [1/2]

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

Definition at line 22 of file WordDecoder.h.

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

◆ get() [2/2]

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

Definition at line 26 of file WordDecoder.h.

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

◆ mask()

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

Definition at line 30 of file WordDecoder.h.

30 {
31 return (word >> offset) & mask;
32 }
static uint32_t mask(uint32_t word, uint8_t offset, uint32_t mask)
Definition WordDecoder.h:30

Member Data Documentation

◆ m_mask

uint32_t LVL1BS::BitField::m_mask
private

Definition at line 17 of file WordDecoder.h.

◆ m_name

std::string LVL1BS::BitField::m_name
private

Definition at line 16 of file WordDecoder.h.

◆ m_shift

uint8_t LVL1BS::BitField::m_shift
private

Definition at line 18 of file WordDecoder.h.


The documentation for this class was generated from the following file: