68 void set(
size_t pos,
bool v =
true) {
70 m_bitset[pos / 8] &= ~(0x1 << (pos & 0x7));
71 m_bitset[pos / 8] |= (
static_cast<uint>(v) << (pos & 0x7));
83 bool test(
size_t pos)
const {
85 return ((
m_bitset[pos / 8] >> (pos & 0x7)) & 0x1);
A simple bitset wrapper class, whose size can be specified after the object has been defined.
Definition: ut0bitset.h:39
Bitset()
Constructor.
Definition: ut0bitset.h:42
size_t m_size
Bitset size in bytes.
Definition: ut0bitset.h:118
bool test(size_t pos) const
Test if the specified bit is set or not.
Definition: ut0bitset.h:83
byte * m_bitset
Bitset bytes.
Definition: ut0bitset.h:115
size_t size() const
Get the size of current bitset.
Definition: ut0bitset.h:90
void copy(const byte *bitset, size_t size)
Copy a byte array and size to current bitmap.
Definition: ut0bitset.h:59
const byte * bitset() const
Get the bitset, don't allow to modify it!
Definition: ut0bitset.h:98
void init(byte *bitset, size_t size)
Initialize the bitset with a byte array and size.
Definition: ut0bitset.h:50
size_t capacity() const
Get the capacity of current bitset.
Definition: ut0bitset.h:94
Bitset & operator=(const Bitset &from)
Set current bitset with specified one.
Definition: ut0bitset.h:105
~Bitset()=default
Destructor.
void reset()
Set all bits to false.
Definition: ut0bitset.h:78
size_t m_capacity
Bitset capacity, could be bigger than m_size if one smaller bitmap has been assigned to it,...
Definition: ut0bitset.h:122
void set(size_t pos, bool v=true)
Set the specified bit to the value 'bit'.
Definition: ut0bitset.h:68
void set()
Set all bits to true.
Definition: ut0bitset.h:75
Fido Client Authentication nullptr
Definition: fido_client_plugin.cc:222
unsigned int uint
Definition: uca9-dump.cc:75
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:69