A simple bitset wrapper class, whose size can be specified after the object has been defined.
More...
#include <ut0bitset.h>
A simple bitset wrapper class, whose size can be specified after the object has been defined.
◆ Bitset()
◆ ~Bitset()
◆ bitset()
const byte * Bitset::bitset |
( |
| ) |
const |
|
inline |
Get the bitset, don't allow to modify it!
- Returns
- current bitset
◆ capacity()
size_t Bitset::capacity |
( |
| ) |
const |
|
inline |
Get the capacity of current bitset.
- Returns
- the capacity of the bitset
◆ copy()
void Bitset::copy |
( |
const byte * |
bitset, |
|
|
size_t |
size |
|
) |
| |
|
inline |
Copy a byte array and size to current bitmap.
- Parameters
-
[in] | bitset | byte array for this bitset |
[in] | size | size of the byte array |
◆ init()
void Bitset::init |
( |
byte * |
bitset, |
|
|
size_t |
size |
|
) |
| |
|
inline |
Initialize the bitset with a byte array and size.
- Parameters
-
[in] | bitset | byte array for this bitset |
[in] | size | size of the byte array |
◆ operator=()
Set current bitset with specified one.
Current bitset should have called init() to allocate its own bitmap memory which should be big enough for the assignment.
- Parameters
-
[in] | from | set the bitset from this one |
- Returns
- current bitset object
◆ reset()
void Bitset::reset |
( |
void |
| ) |
|
|
inline |
◆ set() [1/2]
◆ set() [2/2]
void Bitset::set |
( |
size_t |
pos, |
|
|
bool |
v = true |
|
) |
| |
|
inline |
Set the specified bit to the value 'bit'.
- Parameters
-
[in] | pos | specified bit |
[in] | v | true or false |
◆ size()
size_t Bitset::size |
( |
| ) |
const |
|
inline |
Get the size of current bitset.
- Returns
- the size of the bitset
◆ test()
bool Bitset::test |
( |
size_t |
pos | ) |
const |
|
inline |
Test if the specified bit is set or not.
- Parameters
-
- Returns
- True if this bit is set, otherwise false
◆ m_bitset
◆ m_capacity
size_t Bitset::m_capacity |
|
private |
Bitset capacity, could be bigger than m_size if one smaller bitmap has been assigned to it, after a copy() called.
◆ m_size
The documentation for this class was generated from the following file: