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

Constructor & Destructor Documentation

BLBitSetWordIterator::BLBitSetWordIterator()[1/3]◆ 

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

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

Creates an iterator, that will iterate the given bitSet.

Note
The bitSet cannot change or be destroyed during iteration.

BLBitSetWordIterator::BLBitSetWordIterator(const BLBitSetWordIterator& other)default[3/3]◆ 

Creates a copy of other iterator.

Member Function Documentation

void BLBitSetWordIterator::reset()[1/2]◆ 

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

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

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

uint32_t BLBitSetWordIterator::nextWord()◆ 

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() const◆ 

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

uint32_t BLBitSetWordIterator::wordIndex() const◆ 

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