Bit string class specialization for dynamically allocated bitmaps.
More...
#include <BitString.h>
List of all members.
Public Member Functions |
| BitString (u8 *bitmap=0, const size_t numBits=0) |
| Construct bit string from dynamically allocated bitmaps.
|
void | Set (size_t idx) |
| Set bit at specified position.
|
void | Clear (size_t idx) |
| Clear bit at specified position.
|
bool | IsSet (size_t idx) |
| Check if bit is set at specified position.
|
bool | IsClear (size_t idx) |
| Check if bit is clear at specified position.
|
bool | operator[] (size_t idx) |
| Check if bit is set at specified position.
|
int | FirstSet () |
| Find first set bit.
|
int | FirstClear () |
| Find first clear bit.
|
void | ClearAll () |
| Clear all bits in the string.
|
Detailed Description
template<>
class BitString< 0 >
Bit string class specialization for dynamically allocated bitmaps.
Constructor & Destructor Documentation
Construct bit string from dynamically allocated bitmaps.
- Parameters:
-
bitmap | Pointer to the buffer where the bitmap is allocated. The size of buffer should be enough to hold all bytes occupied by the bitmap bits. |
numBits | Number of bits in the bitmap. |
Member Function Documentation
void BitString< 0 >::Clear |
( |
size_t |
idx | ) |
[inline] |
Clear bit at specified position.
- Parameters:
-
Clear all bits in the string.
Find first clear bit.
- Returns:
- Index of first bit set. -1 if no bits set.
Find first set bit.
- Returns:
- Index of first bit set. -1 if no bits set.
bool BitString< 0 >::IsClear |
( |
size_t |
idx | ) |
[inline] |
Check if bit is clear at specified position.
- Parameters:
-
- Returns:
- true if the bit is clear, false otherwise.
bool BitString< 0 >::IsSet |
( |
size_t |
idx | ) |
[inline] |
Check if bit is set at specified position.
- Parameters:
-
- Returns:
- true if the bit is set, false otherwise.
bool BitString< 0 >::operator[] |
( |
size_t |
idx | ) |
[inline] |
Check if bit is set at specified position.
Equivalent of IsSet method.
- Parameters:
-
- Returns:
- true if the bit is set, false otherwise.
void BitString< 0 >::Set |
( |
size_t |
idx | ) |
[inline] |
Set bit at specified position.
- Parameters:
-
The documentation for this class was generated from the following file: