#include <basebitset.h>
The BaseBitSetIterator allows you to iterate over only the set bits of a bit set. Internally it stores a pointer to the bit set object and an index to the last set bit. If we have reached the end or the iterator is invalid the index will be -1 to match the specification of the bit set.
For simplicity the iterator provides only an increment operator.
You can also use the iterator implicitly in a range-based for loop to iterate over the set bits:
COLLECTION | Type of the bit set. |
Public Types | |
using | CollectionType = COLLECTION |
Public Member Functions | |
BaseBitSetIterator (CollectionType &a, Int start=0) | |
operator Bool () const | |
Int | operator* () const |
Int | GetIndex () const |
Bool | operator== (const BaseBitSetIterator &b) const |
Bool | operator< (const BaseBitSetIterator &b) const |
MAXON_OPERATOR_COMPARISON (BaseBitSetIterator) | |
BaseBitSetIterator & | operator++ () |
BaseBitSetIterator | operator++ (int) |
Static Public Attributes | |
static const Bool | isLinearIterator |
Protected Attributes | |
CollectionType * | _data |
Int | _index |
using CollectionType = COLLECTION |
|
explicit |
operator Bool | ( | ) | const |
Int operator* | ( | ) | const |
Int GetIndex | ( | ) | const |
Bool operator== | ( | const BaseBitSetIterator< COLLECTION > & | b | ) | const |
Bool operator< | ( | const BaseBitSetIterator< COLLECTION > & | b | ) | const |
MAXON_OPERATOR_COMPARISON | ( | BaseBitSetIterator< COLLECTION > | ) |
BaseBitSetIterator& operator++ | ( | ) |
BaseBitSetIterator operator++ | ( | int | ) |
|
static |
|
protected |
|
protected |