Honeycomb
0.1
Component-Model Framework
|
A compact array of bits. Dynamic version of std::bitset. More...
#include <BitSet.h>
Public Member Functions | |
BitSet_ (szt size=0, bool val=false, const Alloc &a=Alloc()) | |
Construct array with size number of bits, each initialized to val More... | |
BitSet_ (const Bytes &bs, const Alloc &a=Alloc()) | |
Construct from bytes in big-endian bit order (the first index will contain the MSB) More... | |
void | resize (szt size, bool val=false) |
Resize array to contain size number of bits, with new bits initialized to val More... | |
void | set (szt index) |
Set bit to true. More... | |
void | set (szt index, bool val) |
Set bit to value. More... | |
void | set () |
Set all bits to true. More... | |
void | reset (szt index) |
Set bit to false. More... | |
void | reset () |
Set all bits false. More... | |
void | flip (szt index) |
Flip value of bit. More... | |
void | flip () |
Flip values of all bits. More... | |
bool | test (szt index) const |
Get bit value. More... | |
bool | all () const |
Test if all bits are true. More... | |
bool | any () const |
Test if any bits are true. More... | |
bool | none () const |
Test if no bits are true. More... | |
szt | count () const |
Count number of true values in bit array. More... | |
szt | size () const |
Number of bits in the bit array. More... | |
szt | blockCount () const |
Number of blocks that the bit array has been split up into. More... | |
const Block * | blocks () const |
Get access to raw blocks that hold the bits. Bit index 0 is the LSB of block 0. More... | |
Block * | blocks () |
Bytes | toBytes () const |
Create Bytes from big-endian bits (the first index contains the MSB) More... | |
Static Public Attributes | |
static const szt | bitsPerBlock = sizeof(Block)*8 |
A compact array of bits. Dynamic version of std::bitset.
|
inline |
Construct array with size
number of bits, each initialized to val
|
inline |
Construct from bytes in big-endian bit order (the first index will contain the MSB)
|
inline |
Test if all bits are true.
|
inline |
Test if any bits are true.
|
inline |
Number of blocks that the bit array has been split up into.
|
inline |
Get access to raw blocks that hold the bits. Bit index 0 is the LSB of block 0.
|
inline |
|
inline |
Count number of true values in bit array.
|
inline |
Flip value of bit.
|
inline |
Flip values of all bits.
|
inline |
Test if no bits are true.
|
inline |
Set bit to false.
|
inline |
Set all bits false.
|
inline |
Resize array to contain size
number of bits, with new bits initialized to val
|
inline |
Set bit to true.
|
inline |
Set bit to value.
|
inline |
Set all bits to true.
|
inline |
Number of bits in the bit array.
|
inline |
Get bit value.
|
inline |
Create Bytes from big-endian bits (the first index contains the MSB)
|
static |