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