Public Member Functions | Private Member Functions | Private Attributes

unifexp::bitVector Class Reference

This class defines a bit vector of fixed length. More...

#include </cur/unifexp/bitvect.h>

List of all members.

Public Member Functions

 bitVector (int length)
 The constructor of a bit vector of the given size.
 ~bitVector ()
 The destructor.
void mark (int bit)
 Marks the given bit.
void unmark (int bit)
 Unmarks the given bit.
int findMarked (int start, int length) const
 Finds the first marked bit starting at the given position.
int findUnmarked (int start, int length) const
 Finds the first unmarked bit starting at the given position.

Private Member Functions

 bitVector (const bitVector &b)
 The copy constructor is not allowed.
bitVectoroperator= (const bitVector &b)
 The assignment operator is not allowed.

Private Attributes

unsigned char * buf
 The array of bytes that represents the bitvector.
int bufSize
 Temporarily: The actual size of the buffer.

Detailed Description

This class defines a bit vector of fixed length.

The bits are initially zero, and can be marked and unmarked. Additionally, convenient functions are available to search for the first marked/unmarked bit in the vector.

Definition at line 47 of file bitvect.h.


Constructor & Destructor Documentation

unifexp::bitVector::bitVector ( int  length ) [inline]

The constructor of a bit vector of the given size.

Definition at line 87 of file bitvect.h.

References buf, and bufSize.

unifexp::bitVector::~bitVector (  ) [inline]

The destructor.

Definition at line 99 of file bitvect.h.

References buf.

unifexp::bitVector::bitVector ( const bitVector b ) [inline, private]

The copy constructor is not allowed.

Definition at line 105 of file bitvect.h.


Member Function Documentation

int unifexp::bitVector::findMarked ( int  start,
int  length 
) const [inline]

Finds the first marked bit starting at the given position.

If not found, returns 'length'.

Definition at line 135 of file bitvect.h.

References buf, and bufSize.

int unifexp::bitVector::findUnmarked ( int  start,
int  length 
) const [inline]

Finds the first unmarked bit starting at the given position.

If not found, returns 'length'.

Definition at line 167 of file bitvect.h.

References buf, and bufSize.

void unifexp::bitVector::mark ( int  bit ) [inline]

Marks the given bit.

Definition at line 117 of file bitvect.h.

References buf, and bufSize.

bitVector & unifexp::bitVector::operator= ( const bitVector b ) [inline, private]

The assignment operator is not allowed.

Definition at line 111 of file bitvect.h.

void unifexp::bitVector::unmark ( int  bit ) [inline]

Unmarks the given bit.

Definition at line 126 of file bitvect.h.

References buf, and bufSize.


Member Data Documentation

unsigned char* unifexp::bitVector::buf [private]

The array of bytes that represents the bitvector.

Definition at line 78 of file bitvect.h.

Referenced by bitVector(), findMarked(), findUnmarked(), mark(), unmark(), and ~bitVector().

Temporarily: The actual size of the buffer.

Definition at line 81 of file bitvect.h.

Referenced by bitVector(), findMarked(), findUnmarked(), mark(), and unmark().


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