CrystalSpace

Public API Reference

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

csBitArray Class Reference

A one-dimensional array of bits, similar to STL bitset. More...

#include <bitarray.h>

List of all members.

Public Methods

 csBitArray (unsigned size)
 construct with size bits. More...

 csBitArray (const csBitArray &that)
 construct as duplicate of that. More...

virtual ~csBitArray ()
 destructor. More...

csBitArray & operator= (const csBitArray &that)
 copy from other array. More...

BitProxy operator[] (unsigned pos)
 return bit at position pos. More...

const BitProxy operator[] (unsigned pos) const
 return bit at position pos. More...

bool operator== (const csBitArray &that) const
 equal to other array. More...

bool operator!= (const csBitArray &that) const
 not equal to other array. More...

csBitArray & operator &= (const csBitArray &that)
 bit-wise and. More...

csBitArray operator|= (const csBitArray &that)
 bit-wise or. More...

csBitArray operator^= (const csBitArray &that)
 bit-wise xor. More...

csBitArray operator~ () const
 Flip all bits. More...

void Clear ()
 Set all bits to false. More...

void SetBit (unsigned pos)
 Set the bit at position pos to true. More...

void ClearBit (unsigned pos)
 Set the bit at position pos to false. More...

void FlipBit (unsigned pos)
 Toggle the bit at position pos. More...

void Set (unsigned pos, bool val)
 Set the bit at position pos to the given value. More...

bool IsBitSet (unsigned pos) const
 Returns true iff the bit at position pos is true. More...

bool AllBitsFalse () const
 Returns true iff all bits are false. More...

csBitArray & FlipAllBits ()
 Change value of all bits. More...

store_type * GetArrayBits ()
 return the full array. More...

unsigned GetSingleWord ()
 Gets quick access to the single-word (only useful when the bit array <= the word size of the machine.). More...

void SetSingleWord (unsigned w)
 Sets the single-word very simply (only useful when the bit array <= the word size of the machine.). More...


Friends

csBitArray operator & (const csBitArray &a1, const csBitArray &a2)
 bit-wise and. More...

csBitArray operator| (const csBitArray &a1, const csBitArray &a2)
 bit-wise or. More...

csBitArray operator^ (const csBitArray &a1, const csBitArray &a2)
 bit-wise xor. More...


Detailed Description

A one-dimensional array of bits, similar to STL bitset.

Definition at line 32 of file bitarray.h.


Constructor & Destructor Documentation

csBitArray::csBitArray unsigned    size [inline, explicit]
 

construct with size bits.

Definition at line 127 of file bitarray.h.

Referenced by operator~.

csBitArray::csBitArray const csBitArray &    that [inline]
 

construct as duplicate of that.

Definition at line 135 of file bitarray.h.

virtual csBitArray::~csBitArray   [inline, virtual]
 

destructor.

Definition at line 142 of file bitarray.h.


Member Function Documentation

bool csBitArray::AllBitsFalse   const [inline]
 

Returns true iff all bits are false.

Definition at line 295 of file bitarray.h.

void csBitArray::Clear   [inline]
 

Set all bits to false.

Definition at line 255 of file bitarray.h.

void csBitArray::ClearBit unsigned    pos [inline]
 

Set the bit at position pos to false.

Definition at line 268 of file bitarray.h.

Referenced by Set.

csBitArray& csBitArray::FlipAllBits   [inline]
 

Change value of all bits.

Definition at line 304 of file bitarray.h.

void csBitArray::FlipBit unsigned    pos [inline]
 

Toggle the bit at position pos.

Definition at line 275 of file bitarray.h.

store_type* csBitArray::GetArrayBits   [inline]
 

return the full array.

Definition at line 314 of file bitarray.h.

unsigned csBitArray::GetSingleWord   [inline]
 

Gets quick access to the single-word (only useful when the bit array <= the word size of the machine.).

Definition at line 323 of file bitarray.h.

bool csBitArray::IsBitSet unsigned    pos const [inline]
 

Returns true iff the bit at position pos is true.

Definition at line 288 of file bitarray.h.

csBitArray& csBitArray::operator &= const csBitArray &    that [inline]
 

bit-wise and.

Definition at line 200 of file bitarray.h.

References mNumBits, and mpStore.

bool csBitArray::operator!= const csBitArray &    that const [inline]
 

not equal to other array.

Definition at line 194 of file bitarray.h.

csBitArray& csBitArray::operator= const csBitArray &    that [inline]
 

copy from other array.

Definition at line 153 of file bitarray.h.

References mNumBits, and mpStore.

bool csBitArray::operator== const csBitArray &    that const [inline]
 

equal to other array.

Definition at line 182 of file bitarray.h.

References mNumBits, and mpStore.

const BitProxy csBitArray::operator[] unsigned    pos const [inline]
 

return bit at position pos.

Definition at line 175 of file bitarray.h.

BitProxy csBitArray::operator[] unsigned    pos [inline]
 

return bit at position pos.

Definition at line 168 of file bitarray.h.

csBitArray csBitArray::operator^= const csBitArray &    that [inline]
 

bit-wise xor.

Definition at line 218 of file bitarray.h.

References mNumBits, and mpStore.

csBitArray csBitArray::operator|= const csBitArray &    that [inline]
 

bit-wise or.

Definition at line 209 of file bitarray.h.

References mNumBits, and mpStore.

csBitArray csBitArray::operator~   const [inline]
 

Flip all bits.

Definition at line 227 of file bitarray.h.

References csBitArray.

void csBitArray::Set unsigned    pos,
bool    val
[inline]
 

Set the bit at position pos to the given value.

Definition at line 282 of file bitarray.h.

References ClearBit, and SetBit.

void csBitArray::SetBit unsigned    pos [inline]
 

Set the bit at position pos to true.

Definition at line 261 of file bitarray.h.

Referenced by Set.

void csBitArray::SetSingleWord unsigned    w [inline]
 

Sets the single-word very simply (only useful when the bit array <= the word size of the machine.).

Definition at line 332 of file bitarray.h.


Friends And Related Function Documentation

csBitArray operator & const csBitArray &    a1,
const csBitArray &    a2
[friend]
 

bit-wise and.

Definition at line 233 of file bitarray.h.

csBitArray operator^ const csBitArray &    a1,
const csBitArray &    a2
[friend]
 

bit-wise xor.

Definition at line 245 of file bitarray.h.

csBitArray operator| const csBitArray &    a1,
const csBitArray &    a2
[friend]
 

bit-wise or.

Definition at line 239 of file bitarray.h.


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