18#ifndef __LIBSTD_BITARRAY_H
19#define __LIBSTD_BITARRAY_H
87 void set(
const Size bit,
const bool value =
true);
109 const Size offset = 0,
110 const Size boundary = 1);
Represents an array of bits.
void setArray(u8 *array, const Size bitCount=ZERO)
Use the given pointer as the BitArray buffer.
u8 * array() const
Retrieve a pointer to the internal BitArray.
u8 * m_array
Array containing the bits.
void set(const Size bit, const bool value=true)
Sets the given bit to the given value.
Size m_set
Set bits in the array.
Size calculateBitmapSize(const Size bitCount) const
Calculate required size of bitmap array in bytes.
Size m_bitCount
Total number of bits in the array.
bool isSet(const Size bit) const
Verify if a given bit is set.
bool operator[](const Size bit) const
Retrieve the value of the given bit.
Size count(const bool on) const
Get the number of bits in the map which have the given value.
void unset(const Size bit)
Sets the given bit to zero.
virtual ~BitArray()
Class destructor.
void clear()
Set all bits to zero.
void setRange(const Size from, const Size to)
Set a range of bits inside the map to 1.
Result setNext(Size *bit, const Size count=1, const Size offset=0, const Size boundary=1)
Sets the next unset bit(s).
bool m_allocated
True if m_array was allocated interally.
Size size() const
Returns the maximum size of this Container.
unsigned int Size
Any sane size indicator cannot go negative.
unsigned char u8
Unsigned 8-bit number.