csBitArray Class Reference
A one-dimensional array of bits, similar to STL bitset. More...
#include <csutil/bitarray.h>
Public Types | |
typedef unsigned long | store_type |
Public Member Functions | |
bool | AllBitsFalse () const |
Returns true if all bits are false. | |
bool | AreSomeBitsSet (size_t pos, size_t count) const |
Checks whether at least one of count bits is set starting at pos. | |
void | Clear () |
Set all bits to false. | |
void | ClearBit (size_t pos) |
Set the bit at position pos to false. | |
csBitArray (const csBitArray &that) | |
Construct as duplicate of that (copy constructor). | |
csBitArray (size_t size) | |
Construct with a size of size bits. | |
csBitArray () | |
Default constructor. | |
void | Delete (size_t pos, size_t count) |
Delete from the array count bits starting at pos, making the array shorter. | |
csBitArray & | FlipAllBits () |
Change value of all bits. | |
void | FlipBit (size_t pos) |
Toggle the bit at position pos. | |
store_type * | GetArrayBits () |
Return the full backing-store. | |
store_type | GetSingleWord () |
Gets quick access to the single-word (only useful when the bit array <= the word size of the machine. | |
size_t | GetSize () const |
Return the number of stored bits. | |
bool | IsBitSet (size_t pos) const |
Returns true if the bit at position pos is true. | |
size_t | Length () const |
Return the number of stored bits. | |
csBitArray & | operator &= (const csBitArray &that) |
Bit-wise `and'. The arrays must be the same length. | |
bool | operator!= (const csBitArray &that) const |
Not equal to other array? | |
csBitArray & | operator= (const csBitArray &that) |
Copy from other array. | |
bool | operator== (const csBitArray &that) const |
Equal to other array? | |
bool | operator[] (size_t pos) const |
Return bit at position pos. | |
BitProxy | operator[] (size_t pos) |
Return bit at position pos. | |
csBitArray | operator^= (const csBitArray &that) |
Bit-wise `xor'. The arrays must be the same length. | |
csBitArray | operator|= (const csBitArray &that) |
Bit-wise `or'. The arrays must be the same length. | |
csBitArray | operator~ () const |
Return complement bit array in which all bits are flipped from this one. | |
void | Set (size_t pos, bool val=true) |
Set the bit at position pos to the given value. | |
void | SetBit (size_t pos) |
Set the bit at position pos to true. | |
void | SetLength (size_t newSize) |
Set the number of stored bits. | |
void | SetSingleWord (store_type sw) |
Sets the single-word very simply (only useful when the bit array <= the word size of the machine. | |
void | SetSize (size_t newSize) |
Set the number of stored bits. | |
csBitArray | Slice (size_t pos, size_t count) const |
Return a new bit array containing a slice count bits in length from this array starting at pos. | |
~csBitArray () | |
Destructor. | |
Friends | |
class | BitProxy |
class | csComparator< csBitArray, csBitArray > |
class | csHashComputer< csBitArray > |
csBitArray | operator & (const csBitArray &a1, const csBitArray &a2) |
Bit-wise `and'. The arrays must be the same length. | |
csBitArray | operator^ (const csBitArray &a1, const csBitArray &a2) |
Bit-wise `xor'. The arrays must be the same length. | |
csBitArray | operator| (const csBitArray &a1, const csBitArray &a2) |
Bit-wise `or'. The arrays must be the same length. | |
Classes | |
class | BitProxy |
Detailed Description
A one-dimensional array of bits, similar to STL bitset.
Definition at line 44 of file bitarray.h.
Constructor & Destructor Documentation
|
Default constructor.
Definition at line 150 of file bitarray.h. |
|
Construct with a size of size bits.
Definition at line 158 of file bitarray.h. |
|
Construct as duplicate of that (copy constructor).
Definition at line 167 of file bitarray.h. |
|
Destructor.
Definition at line 174 of file bitarray.h. |
Member Function Documentation
|
Returns true if all bits are false.
Definition at line 429 of file bitarray.h. |
|
Checks whether at least one of count bits is set starting at pos.
Definition at line 409 of file bitarray.h. References CS_ASSERT. Referenced by csBlockAllocator< csBSPTree >::Compact(). |
|
Set all bits to false.
Definition at line 365 of file bitarray.h. |
|
Set the bit at position pos to false.
Definition at line 378 of file bitarray.h. References CS_ASSERT. |
|
Delete from the array count bits starting at pos, making the array shorter.
Definition at line 452 of file bitarray.h. References CS_ASSERT. Referenced by csBlockAllocator< csBSPTree >::Compact(). |
|
Change value of all bits.
Definition at line 439 of file bitarray.h. |
|
Toggle the bit at position pos.
Definition at line 385 of file bitarray.h. References CS_ASSERT. |
|
Return the full backing-store.
Definition at line 481 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 490 of file bitarray.h. References CS_ASSERT. |
|
Return the number of stored bits.
Definition at line 181 of file bitarray.h. |
|
Returns true if the bit at position pos is true.
Definition at line 401 of file bitarray.h. References CS_ASSERT. Referenced by csBlockAllocator< csBSPTree >::DisposeAll(), and csBitArray::BitProxy::operator=(). |
|
Return the number of stored bits.
Definition at line 190 of file bitarray.h. |
|
Bit-wise `and'. The arrays must be the same length.
Definition at line 304 of file bitarray.h. References CS_ASSERT, GetStore(), and mNumBits. |
|
Not equal to other array?
Definition at line 298 of file bitarray.h. |
|
Copy from other array.
Definition at line 260 of file bitarray.h. References GetStore(), and mNumBits. |
|
Equal to other array?
Definition at line 284 of file bitarray.h. References GetStore(), and mNumBits. |
|
Return bit at position pos.
Definition at line 278 of file bitarray.h. |
|
Return bit at position pos.
Definition at line 271 of file bitarray.h. References CS_ASSERT. |
|
Bit-wise `xor'. The arrays must be the same length.
Definition at line 326 of file bitarray.h. References CS_ASSERT, GetStore(), and mNumBits. |
|
Bit-wise `or'. The arrays must be the same length.
Definition at line 315 of file bitarray.h. References CS_ASSERT, GetStore(), and mNumBits. |
|
Return complement bit array in which all bits are flipped from this one.
Definition at line 337 of file bitarray.h. |
|
Set the bit at position pos to the given value.
Definition at line 392 of file bitarray.h. |
|
Set the bit at position pos to true.
Definition at line 371 of file bitarray.h. References CS_ASSERT. Referenced by Slice(). |
|
Set the number of stored bits.
Definition at line 199 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 500 of file bitarray.h. References CS_ASSERT. |
|
Set the number of stored bits.
Definition at line 209 of file bitarray.h. |
|
Return a new bit array containing a slice count bits in length from this array starting at pos. Does not modify this array. Definition at line 470 of file bitarray.h. |
Friends And Related Function Documentation
|
Bit-wise `and'. The arrays must be the same length.
Definition at line 343 of file bitarray.h. |
|
Bit-wise `xor'. The arrays must be the same length.
Definition at line 355 of file bitarray.h. |
|
Bit-wise `or'. The arrays must be the same length.
Definition at line 349 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.4.6