csBitArray Class Reference
A one-dimensional array of bits, similar to STL bitset. More...
#include <bitarray.h>
Public Methods | |
csBitArray () | |
Defalut constructor. | |
csBitArray (size_t size) | |
Construct with a size of size bits. | |
csBitArray (const csBitArray &that) | |
Construct as duplicate of that (copy constructor). | |
virtual | ~csBitArray () |
Destructor. | |
size_t | Length () const |
Return the number of stored bits. | |
void | SetLength (size_t newSize) |
Set the number of stored bits. | |
csBitArray & | operator= (const csBitArray &that) |
Copy from other array. | |
BitProxy | operator[] (size_t pos) |
Return bit at position pos . | |
const BitProxy | operator[] (size_t 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 |
Return complement bit array in which all bits are flipped from this one. | |
void | Clear () |
Set all bits to false. | |
void | SetBit (size_t pos) |
Set the bit at position pos to true. | |
void | ClearBit (size_t pos) |
Set the bit at position pos to false. | |
void | FlipBit (size_t pos) |
Toggle the bit at position pos. | |
void | Set (size_t pos, bool val) |
Set the bit at position pos to the given value. | |
bool | IsBitSet (size_t pos) const |
Returns true if the bit at position pos is true. | |
bool | AreSomeBitsSet (size_t pos, size_t count) const |
Checks whether at least one of count bits is set from position pos on. | |
bool | AllBitsFalse () const |
Returns true iff all bits are false. | |
csBitArray & | FlipAllBits () |
Change value of all bits. | |
store_type * | GetArrayBits () |
Return the full array. | |
store_type | GetSingleWord () |
Gets quick access to the single-word (only useful when the bit array <= the word size of the machine.). | |
void | SetSingleWord (store_type sw) |
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 34 of file bitarray.h.
Constructor & Destructor Documentation
|
Defalut constructor.
Definition at line 147 of file bitarray.h. |
|
Construct with a size of size bits.
Definition at line 157 of file bitarray.h. |
|
Construct as duplicate of that (copy constructor).
Definition at line 168 of file bitarray.h. |
|
Destructor.
Definition at line 175 of file bitarray.h. |
Member Function Documentation
|
Returns true iff all bits are false.
Definition at line 365 of file bitarray.h. |
|
Checks whether at least one of count bits is set from position pos on.
Definition at line 345 of file bitarray.h. |
|
Set all bits to false.
Definition at line 302 of file bitarray.h. |
|
Set the bit at position pos to false.
Definition at line 315 of file bitarray.h. |
|
Change value of all bits.
Definition at line 374 of file bitarray.h. |
|
Toggle the bit at position pos.
Definition at line 322 of file bitarray.h. |
|
Return the full array.
Definition at line 384 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 393 of file bitarray.h. |
|
Returns true if the bit at position pos is true.
Definition at line 335 of file bitarray.h. |
|
Return the number of stored bits.
Definition at line 182 of file bitarray.h. |
|
Bit-wise `and'.
Definition at line 247 of file bitarray.h. |
|
Not equal to other array.
Definition at line 241 of file bitarray.h. |
|
Copy from other array.
Definition at line 204 of file bitarray.h. |
|
Equal to other array.
Definition at line 229 of file bitarray.h. |
|
Return bit at position
Definition at line 222 of file bitarray.h. |
|
Return bit at position
Definition at line 215 of file bitarray.h. |
|
Bit-wise `xor'.
Definition at line 265 of file bitarray.h. |
|
Bit-wise `or'.
Definition at line 256 of file bitarray.h. |
|
Return complement bit array in which all bits are flipped from this one.
Definition at line 274 of file bitarray.h. |
|
Set the bit at position pos to the given value.
Definition at line 329 of file bitarray.h. |
|
Set the bit at position pos to true.
Definition at line 308 of file bitarray.h. |
|
Set the number of stored bits.
Definition at line 192 of file bitarray.h. |
|
Sets the single-word very simply (only useful when the bit array <= the word size of the machine.).
Definition at line 402 of file bitarray.h. |
Friends And Related Function Documentation
|
Bit-wise `and'.
Definition at line 280 of file bitarray.h. |
|
Bit-wise `xor'.
Definition at line 292 of file bitarray.h. |
|
Bit-wise `or'.
Definition at line 286 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