Efficient, value‐semantic contiguous array of boolean (bit) values.
Synopsis
Declared in <bdlc_bitarray.h>
class BitArray;
Description
This class implements an efficient, value‐semantic array of boolean (a.k.a. bit, i.e., binary digit) values stored in contiguous memory. The physical capacity of this array may grow, but never shrinks. Capacity may be reserved initially via a constructor, or at any time thereafter by using the reserveCapacity method; otherwise, capacity will be increased automatically as needed. Note that capacity is not a salient attribute of this object, and, as such, does not contribute to overall value. Also note that this class provides an implicit no‐throw guarantee for all methods (including manipulators) that do not attempt to alter capacity.
Enums
Name |
Description |
Constants describing the storage representation of a |
Member Functions
Name |
Description |
|
Constructors |
|
Destroy this object. |
Assign to this array the value of the specified |
|
Return the allocator used by this object to supply memory. |
|
|
|
|
|
|
|
|
|
|
|
Set all bits in this array to the specified |
|
Set to 0 the value of every bit in this array. |
|
Set to 1 the value of every bit in this array. |
|
Assign low‐order bits from |
|
Assign to this object the value read from the specified input stream. |
|
Write this object to the specified output stream using |
|
Return |
|
Return the highest index of a 0 bit in the optional range. |
|
Return the lowest index of a 0 bit in the optional range. |
|
Return the highest index of a 1 bit in the optional range. |
|
Return the lowest index of a 1 bit in the optional range. |
|
|
|
Return |
|
Return |
|
Return |
|
Return the number of bits in this array. |
|
|
|
Return the number of 0 bits in the optionally specified range. |
|
Return the number of 1 bits in the optionally specified range. |
|
Bitwise AND |
|
Bitwise MINUS |
|
Left‐shift this bit array by |
|
Right‐shift this bit array by |
|
Return the value of the bit at the specified |
|
Bitwise XOR |
|
Bitwise OR |
|
|
|
Format this object to the specified output stream. |
|
|
|
Remove all of the bits in this array, leaving the length 0, but having no effect on capacity. |
|
Reserve capacity for at least |
|
Rotate the bits in this array left by |
|
Rotate the bits in this array right by |
|
Set the number of bits in this array to |
|
Efficiently exchange the value of this object with that of |
|
Exchange the bit values at |
|
|
|
Complement the value of every bit in this array. Note that the behavior is analogous to applying the |
|
|
Static Member Functions
Name |
Description |
|
Static Data Members
Name |
Description |
Sentinel index value indicating an invalid bit position. |
Friends
Name |
Description |
Return |
Non-Member Functions
Name |
Description |
Return |
|
Return the bitwise AND of the specified |
|
Return the bitwise MINUS of the specified |
|
Return |
|
Return |
|
Return the bitwise XOR of the specified |
|
Return the bitwise OR of the specified |
|
Return the bitwise complement ("toggle") of the specified |
|
Exchange the values of the specified |
Created with MrDocs