Nugget
Loading...
Searching...
No Matches
Public Member Functions | Static Public Attributes | List of all members
Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T > Struct Template Reference

#include <common/util/bitfield.hh>

Public Member Functions

 BitFieldHelper ()
 

Static Public Attributes

static constexpr unsigned offset = Offset
 
static constexpr unsigned width = Width
 
static constexpr unsigned firstByteOffset = offset / 8
 
static constexpr unsigned lastByteOffset = (offset + width - 1) / 8
 
static constexpr unsigned bytesCount = lastByteOffset - firstByteOffset + 1
 
static constexpr unsigned shift = offset % 8
 
static constexpr uint32_t mask = (1 << width) - 1
 
static constexpr bool isAlignedAndSafe
 
static constexpr bool fullBytes = ((width % 8) == 0) && ((offset % 8) == 0)
 

Constructor & Destructor Documentation

◆ BitFieldHelper()

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::BitFieldHelper ( )
inline

Member Data Documentation

◆ bytesCount

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
constexpr unsigned Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::bytesCount = lastByteOffset - firstByteOffset + 1
staticconstexpr

◆ firstByteOffset

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
constexpr unsigned Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::firstByteOffset = offset / 8
staticconstexpr

◆ fullBytes

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
constexpr bool Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::fullBytes = ((width % 8) == 0) && ((offset % 8) == 0)
staticconstexpr

◆ isAlignedAndSafe

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
constexpr bool Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::isAlignedAndSafe
staticconstexpr
Initial value:
=
((firstByteOffset % sizeof(T)) == 0) && (firstByteOffset + sizeof(T)) <= storageSize
static constexpr unsigned firstByteOffset
Definition bitfield.hh:103

◆ lastByteOffset

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
constexpr unsigned Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::lastByteOffset = (offset + width - 1) / 8
staticconstexpr

◆ mask

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
constexpr uint32_t Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::mask = (1 << width) - 1
staticconstexpr

◆ offset

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
constexpr unsigned Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::offset = Offset
staticconstexpr

◆ shift

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
constexpr unsigned Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::shift = offset % 8
staticconstexpr

◆ width

template<unsigned Offset, unsigned Width, unsigned storageSize, std::integral T>
constexpr unsigned Utilities::BitFieldInternal::BitFieldHelper< Offset, Width, storageSize, T >::width = Width
staticconstexpr

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