![]() |
Public API Reference |
#include <bitset.h>
Public Methods | |
csBitSet () | |
Create an empty bit set. More... | |
csBitSet (unsigned iBitCount) | |
Create bit set of given size. More... | |
~csBitSet () | |
Destroy the bit array. More... | |
unsigned | GetByteCount () const |
Query number of bytes used to represent bit set. More... | |
unsigned | GetBitCount () const |
Query number of bits represented by bit set. More... | |
void | Resize (unsigned iBitCount) |
Resize the array. More... | |
unsigned char * | GetBits () const |
Get a pointer to entire array for custom manipulations. More... | |
void | Reset () |
Clear the entire array. More... | |
void | Set () |
Set all the bits to one. More... | |
void | Set (unsigned index) |
Set a bit in the array. More... | |
void | Set (unsigned index, unsigned count) |
Set a number of bits in the array, starting with given index. More... | |
void | Reset (unsigned index) |
Reset a bit in the array. More... | |
void | Reset (unsigned index, unsigned count) |
Set a number of bits in the array, starting with given index. More... | |
bool | Get (unsigned index) const |
Get the value of a bit in the array. More... | |
bool | operator[] (unsigned index) const |
Same but in a more nice form. More... | |
csBitSet & | operator|= (csBitSet &bs) |
OR two bit sets together. More... | |
csBitSet & | operator &= (csBitSet &bs) |
AND two bit sets together. More... | |
char * | Description () const |
Dump an ASCII representation of the bit set to a string. More... |
The csBitSet class allow you to allocate, resize and manipulate such an array.
The bit set is a highly effective way to store an array of booleans. The implementation uses assembly whenever possible, and most methods are inline, thus it is highly recommended to use it whenever possible.
Definition at line 62 of file bitset.h.
|
Create an empty bit set.
|
|
Create bit set of given size.
|
|
Destroy the bit array.
|
|
Dump an ASCII representation of the bit set to a string. Caller is responsible for destroying the returned string with delete[]. |
|
Get the value of a bit in the array.
|
|
Query number of bits represented by bit set.
|
|
Get a pointer to entire array for custom manipulations.
|
|
Query number of bytes used to represent bit set.
|
|
AND two bit sets together.
Definition at line 205 of file bitset.h. References uint32. |
|
Same but in a more nice form.
|
|
OR two bit sets together.
Definition at line 187 of file bitset.h. References uint32. |
|
Set a number of bits in the array, starting with given index.
|
|
Reset a bit in the array.
|
|
Clear the entire array.
|
|
Resize the array.
|
|
Set a number of bits in the array, starting with given index.
|
|
Set a bit in the array.
|
|
Set all the bits to one.
|