 |
Xyris
0.5
|
Go to the documentation of this file.
41 for (
size_t i = 0; i < S; i++)
50 [[gnu::always_inline]]
size_t Size()
60 [[gnu::always_inline]]
void Set(
size_t pos)
70 [[gnu::always_inline]]
void Reset(
size_t pos)
80 [[gnu::always_inline]]
void Flip(
size_t pos)
91 [[gnu::always_inline]]
bool Test(
size_t pos)
118 for (
size_t i = 0; i < S; i++) {
119 if (
Test(i) == isSet)
135 size_t checkLow, checkHigh, check, idx, offset;
136 size_t mask = ((size_t)1 << count) - (size_t)1;
137 for (
size_t i = 0UL; i < S - count; i++) {
140 checkLow =
map[idx] >> offset;
141 checkHigh = offset ?
map[idx + 1] << (
TypeSize() - offset) : 0;
142 check = checkLow | checkHigh;
144 if ((check & mask) == isSet)
154 return sizeof(size_t) * CHAR_BIT;
157 [[gnu::always_inline]]
size_t Index(
size_t bit)
162 [[gnu::always_inline]]
size_t Offset(
size_t bit)
bool Test(size_t pos)
Return the value of the bit at the given position.
void Set(size_t pos)
Set the bit for a given position.
size_t Offset(size_t bit)
Standard string and memory utility library.
bool operator[](size_t pos)
Return the value of the bit at the given position Same functionality as Test() as an operator This op...
size_t FindFirstBit(bool isSet)
Finds and returns the position of the first clear bit.
Bitset()
Construct a new Bitset object and initalize the bitmap to zero.
Architecture control and initialization.
void Flip(size_t pos)
Flip the bit at the given position.
size_t FindFirstRange(size_t count, bool isSet)
Finds a range of count clear bits and returns the starting position.
Bitset(size_t val)
Construct a new Bitset object and initialize the bitmap with the desired value.
void * memset(void *bufptr, int value, size_t size)
Sets the number of bytes in memory at ptr to the value.
size_t Size()
Returns the size of the bitset in bytes.
void Reset(size_t pos)
Reset (clear) the bit at the given position.