csBitArray Class Reference
A one-dimensional array of bits, similar to STL bitset. More...
#include <bitarray.h>
Public Methods | |
csBitArray (unsigned size) | |
construct with size bits. | |
csBitArray (const csBitArray &that) | |
construct as duplicate of that . | |
virtual | ~csBitArray () |
destructor | |
csBitArray & | operator= (const csBitArray &that) |
copy from other array | |
BitProxy | operator[] (unsigned pos) |
return bit at position pos | |
const BitProxy | operator[] (unsigned pos) const |
return bit at position pos | |
bool | operator== (const csBitArray &that) const |
equal to other array | |
bool | operator!= (const csBitArray &that) const |
not equal to other array | |
csBitArray & | operator &= (const csBitArray &that) |
bit-wise and | |
csBitArray | operator|= (const csBitArray &that) |
bit-wise or | |
csBitArray | operator^= (const csBitArray &that) |
bit-wise xor | |
csBitArray | operator~ () const |
Flip all bits. | |
void | Clear () |
Set all bits to false. | |
void | SetBit (unsigned pos) |
Set the bit at position pos to true. | |
void | ClearBit (unsigned pos) |
Set the bit at position pos to false. | |
void | FlipBit (unsigned pos) |
Toggle the bit at position pos. | |
void | Set (unsigned pos, bool val) |
Set the bit at position pos to the given value. | |
bool | IsBitSet (unsigned pos) const |
Returns true iff the bit at position pos is true. | |
bool | AllBitsFalse () const |
Returns true iff all bits are false. | |
csBitArray & | FlipAllBits () |
Change value of all bits. | |
store_type * | GetArrayBits () |
return the full array | |
unsigned | GetSingleWord () |
Gets quick access to the single-word (only useful when the bit array <= the word size of the machine.). | |
void | SetSingleWord (unsigned w) |
Sets the single-word very simply (only useful when the bit array <= the word size of the machine.). | |
Friends | |
csBitArray | operator & (const csBitArray &a1, const csBitArray &a2) |
bit-wise and | |
csBitArray | operator| (const csBitArray &a1, const csBitArray &a2) |
bit-wise or | |
csBitArray | operator^ (const csBitArray &a1, const csBitArray &a2) |
bit-wise xor |
Detailed Description
A one-dimensional array of bits, similar to STL bitset.
Definition at line 30 of file bitarray.h.
Constructor & Destructor Documentation
|
construct with
Definition at line 125 of file bitarray.h. Referenced by operator~(). |
|
construct as duplicate of
Definition at line 133 of file bitarray.h. |
|
destructor
Definition at line 140 of file bitarray.h. |
Member Function Documentation
|
Returns true iff all bits are false.
Definition at line 293 of file bitarray.h. |
|
Set all bits to false.
Definition at line 253 of file bitarray.h. |
|
Set the bit at position pos to false.
Definition at line 266 of file bitarray.h. Referenced by Set(). |
|
Change value of all bits.
Definition at line 302 of file bitarray.h. |
|
Toggle the bit at position pos.
Definition at line 273 of file bitarray.h. |
|
return the full array
Definition at line 312 of file bitarray.h. |
|
Gets quick access to the single-word (only useful when the bit array <= the word size of the machine.).
Definition at line 321 of file bitarray.h. |
|
Returns true iff the bit at position pos is true.
Definition at line 286 of file bitarray.h. |
|
bit-wise and
Definition at line 198 of file bitarray.h. |
|
not equal to other array
Definition at line 192 of file bitarray.h. |
|
copy from other array
Definition at line 151 of file bitarray.h. |
|
equal to other array
Definition at line 180 of file bitarray.h. |
|
return bit at position
Definition at line 173 of file bitarray.h. |
|
return bit at position
Definition at line 166 of file bitarray.h. |
|
bit-wise xor
Definition at line 216 of file bitarray.h. |
|
bit-wise or
Definition at line 207 of file bitarray.h. |
|
Flip all bits.
Definition at line 225 of file bitarray.h. References csBitArray(). |
|
Set the bit at position pos to the given value.
Definition at line 280 of file bitarray.h. References ClearBit(), and SetBit(). |
|
Set the bit at position pos to true.
Definition at line 259 of file bitarray.h. Referenced by Set(). |
|
Sets the single-word very simply (only useful when the bit array <= the word size of the machine.).
Definition at line 330 of file bitarray.h. |
Friends And Related Function Documentation
|
bit-wise and
Definition at line 231 of file bitarray.h. |
|
bit-wise xor
Definition at line 243 of file bitarray.h. |
|
bit-wise or
Definition at line 237 of file bitarray.h. |
The documentation for this class was generated from the following file:
- csutil/bitarray.h
Generated for Crystal Space by doxygen 1.2.18