Phoenix
Object-oriented orthogonally persistent operating system
Public Member Functions
BitString< 0 > Class Template Reference

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

BitString< 0 >::BitString ( u8 bitmap = 0,
const size_t  numBits = 0 
) [inline]

Construct bit string from dynamically allocated bitmaps.

Parameters:
bitmapPointer to the buffer where the bitmap is allocated. The size of buffer should be enough to hold all bytes occupied by the bitmap bits.
numBitsNumber of bits in the bitmap.

Member Function Documentation

void BitString< 0 >::Clear ( size_t  idx) [inline]

Clear bit at specified position.

Parameters:
idxNull based bit index.
void BitString< 0 >::ClearAll ( ) [inline]

Clear all bits in the string.

int BitString< 0 >::FirstClear ( ) [inline]

Find first clear bit.

Returns:
Index of first bit set. -1 if no bits set.
int BitString< 0 >::FirstSet ( ) [inline]

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:
idxNull based bit index.
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:
idxNull based bit index.
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:
idxNull based bit index.
Returns:
true if the bit is set, false otherwise.
void BitString< 0 >::Set ( size_t  idx) [inline]

Set bit at specified position.

Parameters:
idxNull based bit index.

The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines