IndexContainersBLBitSetWordIterator
BLBitSetWordIterator Class Referencefinal

BitSet word iterator [C++ API].

Low-level iterator that sees a BitSet as an array of bit words. It only iterates non-zero words and returns zero at the end of iteration.

A simple way of printing all non-zero words of a BitWord:

set.addRange(100, 200);
while (uint32_t bits = it.nextWord()) {
printf("{WordIndex: %u, WordData: %08X }\n", it.wordIndex(), bits);
}

Public Members

Members

Member Functions

Construction & Destruction
Overloaded Operators
Reset
Iterator Interface

BLBitSetWordIterator::BLBitSetWordIterator()noexcept[1/3][¶]

Creates a default constructed iterator, not initialized to iterate any BitSet.

BLBitSetWordIterator::BLBitSetWordIterator(
const BLBitSetCore& bitSet
)noexcept[2/3][¶]

Creates an iterator, that will iterate the given bitSet.

Note
The bitSet cannot change or be destroyed during iteration.

BLBitSetWordIterator::BLBitSetWordIterator()defaultnoexcept[3/3][¶]

Creates a copy of other iterator.

void BLBitSetWordIterator::reset()noexcept[1/2][¶]

Resets the iterator (puts it into a default constructed state).

void BLBitSetWordIterator::reset(
const BLBitSetCore& bitSet
)noexcept[2/2][¶]

Reinitializes the iterator to iterate the given bitSet, from the beginning.

uint32_t BLBitSetWordIterator::nextWord()noexcept[¶]

Returns the next (or the first, if called the first time) non-zero word of the BitSet or zero if the iteration ended.

Use wordIndex() to get the index (in word units) of the word returned.

uint32_t BLBitSetWordIterator::bitIndex() constnoexcept[¶]

Returns the current bit index of a word returned by nextWord().

uint32_t BLBitSetWordIterator::wordIndex() constnoexcept[¶]

Returns the current word index of a word returned by nextWord().