BitVectorPointer Class Reference
[Utils - Bit-Vector]

#include <bitvector.h>

Inheritance diagram for BitVectorPointer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

template<size_t S>
 BitVectorPointer (BitVectorBits< S > &bits)
 BitVectorPointer (unsigned *bits, size_t size)
 BitVectorPointer ()
void Reset ()
int Test (unsigned index)
void Set (unsigned index)
void Clear (unsigned index)
int TestSet (unsigned index, size_t count)
int TestClear (unsigned index, size_t count)
void Set (unsigned index, size_t count)
void Clear (unsigned index, size_t count)
int Find (size_t count, unsigned state)

Public Attributes

unsigned * Bits
 Pointer to array where bits are stored.
size_t Size
 Number of bits in bit-vector.

Detailed Description

Object pointing to a bit-vector (array of bits).

This is the concrete class which is used to manipulation the contents of a bit-vector.

See also:
BitVector and BitVectorBits.

Definition at line 124 of file bitvector.h.


Constructor & Destructor Documentation

template<size_t S>
BitVectorPointer::BitVectorPointer ( BitVectorBits< S > &  bits  ) 

Contructor taking a BitVectorBits object.

Parameters:
bits Buffer where bits are stored.

Definition at line 133 of file bitvector.h.

BitVectorPointer::BitVectorPointer ( unsigned *  bits,
size_t  size 
)

Contructor taking an arbitrary block of memory.

Parameters:
bits Add of memory block holding bits for bit-vector.
size Number of bits in bit-vector.

Definition at line 143 of file bitvector.h.

BitVectorPointer::BitVectorPointer (  ) 

Empty contructor.

Definition at line 150 of file bitvector.h.


Member Function Documentation

void BitVectorPointer::Reset (  ) 

Clear all bits.

Definition at line 36 of file bitvector.cpp.

int BitVectorPointer::Test ( unsigned  index  ) 

Test a single bit.

Parameters:
index The bit to test.
Returns:
1 if the bit is set, 0 if it is clear.

Definition at line 46 of file bitvector.cpp.

void BitVectorPointer::Set ( unsigned  index  ) 

Set a single bit.

Parameters:
index The bit to set.

Definition at line 53 of file bitvector.cpp.

void BitVectorPointer::Clear ( unsigned  index  ) 

Clear a single bit.

Parameters:
index The bit to clear.

Definition at line 60 of file bitvector.cpp.

int BitVectorPointer::TestSet ( unsigned  index,
size_t  count 
)

Test if a range of bits are all set.

Parameters:
index The index of the first bit to test.
count The number of bits to test.
Returns:
True if all bits are clear, false otherwise.

Definition at line 309 of file bitvector.cpp.

int BitVectorPointer::TestClear ( unsigned  index,
size_t  count 
)

Test if a range of bits are all clear.

Parameters:
index The index of the first bit to test.
count The number of bits to test.
Returns:
True if all bits are clear, false otherwise.

Definition at line 344 of file bitvector.cpp.

void BitVectorPointer::Set ( unsigned  index,
size_t  count 
)

Set a range of bits.

Parameters:
index The index of the first bit to set.
count The number of bits to set.

Definition at line 377 of file bitvector.cpp.

void BitVectorPointer::Clear ( unsigned  index,
size_t  count 
)

Clear a range of bits.

Parameters:
index The index of the first bit to clear.
count The number of bits to clear.

Definition at line 412 of file bitvector.cpp.

int BitVectorPointer::Find ( size_t  count,
unsigned  state 
)

Find an region of consecutive bits of the specified state.

Parameters:
count The number of required bits.
state True to find a region of set bits, false to find clear bits.
Returns:
The index of the first bit in the region allocated, or -1 if no region was found.

Definition at line 450 of file bitvector.cpp.


The documentation for this class was generated from the following files:

Generated by  doxygen 1.6.1