The bitfield class. More...
#include "murl_bitfield.h"
Public Member Functions | |
Bitfield () | |
The default constructor. More... | |
void | Empty () |
Empty the bitfield. | |
void | Set (UInt32 bitIndex) |
Set a bit in the bitfield. More... | |
void | Clear (UInt32 bitIndex) |
Clear a bit in the bitfield. More... | |
Bool | IsSet (UInt32 bitIndex) const |
Check if a bit is set in the bitfield. More... | |
Bool | IsCleared (UInt32 bitIndex) const |
Check if a bit is cleared in the bitfield. More... | |
UInt32 | GetBitsCount () const |
Get the number of allocated bits in the bitfield. More... | |
UInt32 | SetBitsCount (UInt32 numBits) |
Set the number of bits in the bitfield. More... | |
const UInt8 * | Begin () const |
Get the pointer to the first bitfield byte. More... | |
const UInt8 * | End () const |
Get the pointer next to the last bitfield byte. More... | |
UInt32 | GetByteSize () const |
Get the byte size of the bitfield. More... | |
Detailed Description
The bitfield class.
Constructor & Destructor Documentation
◆ Bitfield()
|
inline |
The default constructor.
Create an empty bitfield.
Member Function Documentation
◆ Set()
|
inline |
Set a bit in the bitfield.
Extends the bitfield if the bitIndex is greater than the current number of bits, new bits are set to zero.
- Parameters
-
bitIndex The zero based index of the bit to set.
References Murl::Array< DataType >::GetCount(), and Murl::Array< DataType >::SetCount().
◆ Clear()
|
inline |
Clear a bit in the bitfield.
Extends the bitfield if the bitIndex is greater than the current number of bits, new bits are set to zero.
- Parameters
-
bitIndex The zero based index of the bit to clear.
References Murl::Array< DataType >::GetCount(), and Murl::Array< DataType >::SetCount().
◆ IsSet()
Check if a bit is set in the bitfield.
- Parameters
-
bitIndex The zero based index of the bit to test.
- Returns
- true if the bit is set, false if the index is out of range.
References Murl::Array< DataType >::GetCount().
◆ IsCleared()
Check if a bit is cleared in the bitfield.
- Parameters
-
bitIndex The zero based index of the bit to test.
- Returns
- true if the bit is cleared or the index is out of range.
References Murl::Array< DataType >::GetCount().
◆ GetBitsCount()
|
inline |
Get the number of allocated bits in the bitfield.
- Returns
- The number of allocated bits in the bitfield.
References Murl::Array< DataType >::GetCount().
◆ SetBitsCount()
Set the number of bits in the bitfield.
The bitfield is allocated in 32-bit steps, if the bitfield is extended, the new bits are set to zero.
- Parameters
-
numBits The new number of bits in the bitfield.
- Returns
- The number of allocated bits in the bitfield.
References Murl::Array< DataType >::GetCount(), and Murl::Array< DataType >::SetCount().
◆ Begin()
|
inline |
Get the pointer to the first bitfield byte.
- Returns
- The pointer to the first bitfield byte.
References Murl::Array< DataType >::Begin().
◆ End()
|
inline |
Get the pointer next to the last bitfield byte.
- Returns
- The pointer next to the last bitfield byte.
References Murl::Array< DataType >::End().
◆ GetByteSize()
|
inline |
Get the byte size of the bitfield.
- Returns
- The number of bytes used by the bitfield.
References Murl::Array< DataType >::GetCount().
The documentation for this class was generated from the following file:
- murl_bitfield.h