Phoenix
Object-oriented orthogonally persistent operating system
|
Class for manipulating bit strings. More...
#include <BitString.h>
Public Member Functions | |
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. |
Class for manipulating bit strings.
Bit string is a sequence of bits which are indexed by a null-based index. Each bit in a string can be accessed (checked or modified) individually by its index.
numBits | Number of bits in a string. If this parameter is not zero then the string is allocated statically in the class. Otherwise the string is allocated by the caller and the bitmap and number of bits are provided to the constructor. |
void BitString< numBits >::Clear | ( | size_t | idx | ) | [inline] |
Clear bit at specified position.
idx | Null based bit index. |
void BitString< numBits >::ClearAll | ( | ) | [inline] |
Clear all bits in the string.
int BitString< numBits >::FirstClear | ( | ) | [inline] |
Find first clear bit.
int BitString< numBits >::FirstSet | ( | ) | [inline] |
Find first set bit.
bool BitString< numBits >::IsClear | ( | size_t | idx | ) | [inline] |
Check if bit is clear at specified position.
idx | Null based bit index. |
bool BitString< numBits >::IsSet | ( | size_t | idx | ) | [inline] |
Check if bit is set at specified position.
idx | Null based bit index. |
bool BitString< numBits >::operator[] | ( | size_t | idx | ) | [inline] |
Check if bit is set at specified position.
Equivalent of IsSet method.
idx | Null based bit index. |
void BitString< numBits >::Set | ( | size_t | idx | ) | [inline] |
Set bit at specified position.
idx | Null based bit index. |