|
cppcore
A small, portable C++ core library
|
Container to handle specific bitfields. More...
#include <TBitField.h>
Public Member Functions | |
| TBitField ()=default | |
| The default class constructor. | |
| TBitField (T init) | |
| The class constructor with the initial value. | |
| ~TBitField ()=default | |
| The class destructor. | |
| T | getMask () const |
| Returns the current bit-mask. | |
| bool constexpr | getBit (size_t pos) const noexcept |
| Will return the bit at the given position. | |
| void | setBit (size_t pos, bool on) |
| Will set the bit at the given position to the given state. | |
| void | setBit (size_t pos) |
| Will set the bit at the given position to true. | |
| void | clearBit (size_t pos) |
| Will clear the bit at the given postion to false. | |
| void | clear () |
| Will clear all bits, they will set to false. | |
| size_t | maxBits () const |
| Returns the upper limit for bit positions. | |
Container to handle specific bitfields.
Definition at line 37 of file TBitField.h.
|
default |
The default class constructor.
|
inlineexplicit |
The class constructor with the initial value.
| [in] | init | The init value. |
Definition at line 83 of file TBitField.h.
|
default |
The class destructor.
|
inline |
Will clear all bits, they will set to false.
Definition at line 121 of file TBitField.h.
|
inline |
Will clear the bit at the given postion to false.
| [in] | pos | The bit position for write. |
Definition at line 115 of file TBitField.h.
References maxBits().
Referenced by setBit().
|
inlineconstexprnoexcept |
Will return the bit at the given position.
| [in] | pos | The bit position for readout. |
Definition at line 93 of file TBitField.h.
References maxBits().
|
inline |
|
inline |
Returns the upper limit for bit positions.
Definition at line 126 of file TBitField.h.
Referenced by clearBit(), getBit(), setBit(), and setBit().
|
inline |
Will set the bit at the given position to true.
| [in] | pos | The bit position for write. |
Definition at line 109 of file TBitField.h.
References maxBits().
|
inline |
Will set the bit at the given position to the given state.
| [in] | pos | The bit position for write. |
| [in] | on | The bit state to set. |
Definition at line 99 of file TBitField.h.
References clearBit(), maxBits(), and setBit().
Referenced by setBit().