IndexContainersBLBitArray
BLBitArray Class Referencefinal

BitArray container [C++ API].

Member Functions

Construction & Destruction
Overloaded Operators
Common Functionality
Accessors
Test Operations
Equality & Comparison
Content Manipulation

Additional Inherited Members

- Public Attributes inherited from BLObjectCore

BLBitArray::~BLBitArray()noexcept[¶]

Destroys the BitArray.

BLBitArray::operator bool() constexplicitnoexcept[¶]

Tests whether the BitArray has a content.

Note
This is essentially the opposite of empty().

BLBitArray& BLBitArray::operator=(
BLBitArray&& other
)noexcept[1/2][¶]

Move assignment.

Note
The other BitArray is reset by move assignment, so its state after the move operation is the same as a default constructed BitArray.

BLBitArray& BLBitArray::operator=(
const BLBitArray& other
)noexcept[2/2][¶]

Copy assignment, performs weak copy of the data held by the other BitArray.

BLResult BLBitArray::reset()noexcept[¶]

Clears the content of the BitArray and releases its data.

After reset the BitArray content matches a default constructed instance.

void BLBitArray::swap()noexcept[¶]

Swaps the content of this string with the other string.

bool BLBitArray::empty() constnoexcept[¶]

Tests whether the BitArray is empty (has no content).

Returns true if the BitArray's size is zero.

uint32_t BLBitArray::size() constnoexcept[¶]

Returns the size of the BitArray in bits.

uint32_t BLBitArray::wordCount() constnoexcept[¶]

Returns number of BitWords this BitArray uses.

uint32_t BLBitArray::capacity() constnoexcept[¶]

Returns the capacity of the BitArray in bits.

uint32_t BLBitArray::cardinality() constnoexcept[¶]

Returns the number of bits set in the BitArray.

uint32_t BLBitArray::cardinalityInRange(
uint32_t startBit,
uint32_t endBit
) constnoexcept[¶]

Returns the number of bits set in the given [startBit, endBit) range.

const uint32_t* BLBitArray::data() constnoexcept[¶]

Returns bit data.

bool BLBitArray::hasBit(
uint32_t bitIndex
) constnoexcept[¶]

Returns a bit-value at the given bitIndex.

bool BLBitArray::hasBitsInRange(
uint32_t startBit,
uint32_t endBit
) constnoexcept[¶]

Returns whether the bit-set has at least on bit in the given [startBit, endbit) range.

bool BLBitArray::subsumes(
const BLBitArrayCore& other
) constnoexcept[¶]

Returns whether this BitArray subsumes other.

bool BLBitArray::intersects(
const BLBitArrayCore& other
) constnoexcept[¶]

Returns whether this BitArray intersects with other.

bool BLBitArray::equals(
const BLBitArrayCore& other
) constnoexcept[¶]

Returns whether this BitArray and other are bitwise equal.

int BLBitArray::compare(
const BLBitArrayCore& other
) constnoexcept[¶]

Compares this BitArray with other and returns either -1, 0, or 1.

BLResult BLBitArray::assign()noexcept[1/2][¶]

Move assignment, the same as operator=, but returns a BLResult instead of this.

BLResult BLBitArray::assign(
const BLBitArrayCore& other
)noexcept[2/2][¶]

Copy assignment, the same as operator=, but returns a BLResult instead of this.

BLResult BLBitArray::assignWords(
const uint32_t* wordData,
uint32_t wordCount
)noexcept[¶]

Replaces the content of the BitArray by bits specified by wordData of size wordCount [the size is in uint32_t units].

BLResult BLBitArray::clear()noexcept[¶]

Clears the content of the BitArray without releasing its dynamically allocated data, if possible.

BLResult BLBitArray::resize(
uint32_t nBits
)noexcept[¶]

Resizes the BitArray so its size matches nBits.

BLResult BLBitArray::reserve(
uint32_t nBits
)noexcept[¶]

Reserves nBits in the BitArray (capacity would match nBits) without changing its size.

BLResult BLBitArray::shrink()noexcept[¶]

Shrinks the capacity of the BitArray to match the actual content with the intention to save memory.

BLResult BLBitArray::setBit(
uint32_t bitIndex
)noexcept[¶]

Sets a bit to true at the given bitIndex.

BLResult BLBitArray::fillRange(
uint32_t startBit,
uint32_t endBit
)noexcept[¶]

Fills bits in [startBit, endBit) range to true.

BLResult BLBitArray::fillWords(
uint32_t bitIndex,
const uint32_t* wordData,
uint32_t wordCount
)noexcept[¶]

Fills bits starting from bitIndex specified by wordData and wordCount to true (zeros in wordData are ignored).

Note
This operation uses an OR operator - bits in wordData are combined with OR operator with existing bits in BitArray.

BLResult BLBitArray::clearBit(
uint32_t bitIndex
)noexcept[¶]

Sets a bit to false at the given bitIndex.

BLResult BLBitArray::clearRange(
uint32_t startBit,
uint32_t endBit
)noexcept[¶]

Sets bits in [startBit, endBit) range to false.

BLResult BLBitArray::clearWord(
uint32_t bitIndex,
uint32_t wordValue
)noexcept[¶]

Sets bits starting from bitIndex specified by wordValue to false (zeros in wordValue are ignored).

Note
This operation uses an AND_NOT operator - bits in wordData are negated and then combined with AND operator with existing bits in BitArray.

BLResult BLBitArray::clearWords(
uint32_t bitIndex,
const uint32_t* wordData,
uint32_t wordCount
)noexcept[¶]

Sets bits starting from bitIndex specified by wordData and wordCount to false (zeros in wordData are ignored).

Note
This operation uses an AND_NOT operator - bits in wordData are negated and then combined with AND operator with existing bits in BitArray.

BLResult BLBitArray::replaceOp(
uint32_t nBits,
uint32_t** dataOut
)noexcept[¶]

Makes the BitArray mutable with the intention to replace all bits of it.

Note
All bits in the BitArray will be set to zero.

BLResult BLBitArray::replaceBit(
uint32_t bitIndex,
bool bitValue
)noexcept[¶]

Replaces a bit in the BitArray at the given bitIndex to match bitValue.

BLResult BLBitArray::replaceWord(
uint32_t bitIndex,
uint32_t wordValue
)noexcept[¶]

Replaces bits starting from bitIndex to match the bits specified by wordValue.

Note
Replaced bits from BitArray are not combined by using any operator, wordValue is copied as is, thus replaces fully the existing bits.

BLResult BLBitArray::replaceWords(
uint32_t bitIndex,
const uint32_t* wordData,
uint32_t wordCount
)noexcept[¶]

Replaces bits starting from bitIndex to match the bits specified by wordData and wordCount.

Note
Replaced bits from BitArray are not combined by using any operator, wordData is copied as is, thus replaces fully the existing bits.

BLResult BLBitArray::appendBit(
bool bitValue
)noexcept[¶]

Appends a bit bitValue to the BitArray.

BLResult BLBitArray::appendWord(
uint32_t wordValue
)noexcept[¶]

Appends a single word wordValue to the BitArray.

BLResult BLBitArray::appendWords(
const uint32_t* wordData,
uint32_t wordCount
)noexcept[¶]

Appends whole words to the BitArray.