CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

csBitSet Class Reference

A BitSet is an array of bits. More...

#include <bitset.h>

List of all members.

Public Methods

 csBitSet ()
 Create an empty bit set. More...

 csBitSet (unsigned iBitCount)
 Create bit set of given size. More...

 ~csBitSet ()
 Destroy the bit array. More...

unsigned GetByteCount () const
 Query number of bytes used to represent bit set. More...

unsigned GetBitCount () const
 Query number of bits represented by bit set. More...

void Resize (unsigned iBitCount)
 Resize the array. More...

unsigned char * GetBits () const
 Get a pointer to entire array for custom manipulations. More...

void Reset ()
 Clear the entire array. More...

void Set ()
 Set all the bits to one. More...

void Set (unsigned index)
 Set a bit in the array. More...

void Set (unsigned index, unsigned count)
 Set a number of bits in the array, starting with given index. More...

void Reset (unsigned index)
 Reset a bit in the array. More...

void Reset (unsigned index, unsigned count)
 Set a number of bits in the array, starting with given index. More...

bool Get (unsigned index) const
 Get the value of a bit in the array. More...

bool operator[] (unsigned index) const
 Same but in a more nice form. More...

csBitSet & operator|= (csBitSet &bs)
 OR two bit sets together. More...

csBitSet & operator &= (csBitSet &bs)
 AND two bit sets together. More...

char * Description () const
 Dump an ASCII representation of the bit set to a string. More...


Detailed Description

A BitSet is an array of bits.

The csBitSet class allow you to allocate, resize and manipulate such an array.

The bit set is a highly effective way to store an array of booleans. The implementation uses assembly whenever possible, and most methods are inline, thus it is highly recommended to use it whenever possible.

Definition at line 62 of file bitset.h.


Constructor & Destructor Documentation

csBitSet::csBitSet   [inline]
 

Create an empty bit set.

Definition at line 70 of file bitset.h.

csBitSet::csBitSet unsigned    iBitCount [inline]
 

Create bit set of given size.

Definition at line 75 of file bitset.h.

csBitSet::~csBitSet   [inline]
 

Destroy the bit array.

Definition at line 86 of file bitset.h.


Member Function Documentation

char* csBitSet::Description   const [inline]
 

Dump an ASCII representation of the bit set to a string.

Caller is responsible for destroying the returned string with delete[].

Definition at line 226 of file bitset.h.

bool csBitSet::Get unsigned    index const [inline]
 

Get the value of a bit in the array.

Definition at line 179 of file bitset.h.

unsigned csBitSet::GetBitCount   const [inline]
 

Query number of bits represented by bit set.

Definition at line 94 of file bitset.h.

unsigned char* csBitSet::GetBits   const [inline]
 

Get a pointer to entire array for custom manipulations.

Definition at line 122 of file bitset.h.

unsigned csBitSet::GetByteCount   const [inline]
 

Query number of bytes used to represent bit set.

Definition at line 90 of file bitset.h.

csBitSet& csBitSet::operator &= csBitSet &    bs [inline]
 

AND two bit sets together.

Definition at line 205 of file bitset.h.

References uint32.

bool csBitSet::operator[] unsigned    index const [inline]
 

Same but in a more nice form.

Definition at line 183 of file bitset.h.

csBitSet& csBitSet::operator|= csBitSet &    bs [inline]
 

OR two bit sets together.

Definition at line 187 of file bitset.h.

References uint32.

void csBitSet::Reset unsigned    index,
unsigned    count
[inline]
 

Set a number of bits in the array, starting with given index.

Definition at line 161 of file bitset.h.

void csBitSet::Reset unsigned    index [inline]
 

Reset a bit in the array.

Definition at line 157 of file bitset.h.

void csBitSet::Reset   [inline]
 

Clear the entire array.

Definition at line 126 of file bitset.h.

void csBitSet::Resize unsigned    iBitCount [inline]
 

Resize the array.

Definition at line 98 of file bitset.h.

void csBitSet::Set unsigned    index,
unsigned    count
[inline]
 

Set a number of bits in the array, starting with given index.

Definition at line 138 of file bitset.h.

void csBitSet::Set unsigned    index [inline]
 

Set a bit in the array.

Definition at line 134 of file bitset.h.

void csBitSet::Set   [inline]
 

Set all the bits to one.

Definition at line 130 of file bitset.h.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14