A non-mutable bitset-iterator. More...
#include <libecc/bitset.h>
Public Member Functions | |
bitset_iterator (void) | |
Construct uninitialized bitset iterator. | |
bitset_iterator (bitset_iterator const &iter) | |
Copy constructor. | |
bitset_iterator & | operator= (bitset_iterator const &iter) |
Assignment operator. | |
bitset_digit_t | operator* () const |
Access bit as zero or bitmask. | |
bitset_iterator & | operator++ () |
Preincrement. | |
bitset_iterator | operator++ (int) |
Postincrement. | |
bitset_iterator & | operator-- () |
Predecrement. | |
bitset_iterator | operator-- (int) |
Postdecrement. | |
bitset_iterator & | operator+= (int n) |
Iterator addition. | |
bitset_iterator & | operator-= (int n) |
Iterator subtraction. | |
bitset_digit_t | operator[] (int n) const |
Element operator. | |
bitset_iterator (bitset_base< N > const *bitset_ptr, int bit) | |
Construct a bitset iterator that points to bit bit of bitset bitset_ptr. | |
void | find1 (void) |
Return the first position for which the bit is set. | |
Friends | |
bitset_iterator | operator+ (bitset_iterator const &i, int n) |
Iterator addition. | |
bitset_iterator | operator+ (int n, bitset_iterator const &i) |
Iterator addition. | |
bitset_iterator | operator- (bitset_iterator const &i, int n) |
Iterator subtraction. | |
bitset_iterator | operator- (int n, bitset_iterator const &i) |
Iterator subtraction. |
A non-mutable bitset-iterator.
This class represents a 'pointer' to a bit in a given bitset instance. However, operator*
does not return bool
but returns a bitset_digit_t containing zero when the bit is zero and a mask matching the position of the bit in the respective digit when the bit is set.
libecc::bitset_iterator< N, DIRECTION >::bitset_iterator | ( | void | ) | [inline] |
Construct uninitialized bitset iterator.
libecc::bitset_iterator< N, DIRECTION >::bitset_iterator | ( | bitset_iterator< N, DIRECTION > const & | iter | ) | [inline] |
Copy constructor.
libecc::bitset_iterator< N, DIRECTION >::bitset_iterator | ( | bitset_base< N > const * | bitset_ptr, | |
int | bit | |||
) | [inline] |
Construct a bitset iterator that points to bit bit of bitset bitset_ptr.
void libecc::bitset_iterator< N, DIRECTION >::find1 | ( | void | ) | [inline] |
Return the first position for which the bit is set.
References libecc::bitset_index::M_index.
bitset_digit_t libecc::bitset_iterator< N, DIRECTION >::operator* | ( | ) | const [inline] |
Access bit as zero or bitmask.
Returns 0 if the current bit is not set, otherwise returns the bit mask of that bit for the current digit. For example, if this iterator points to bit 130 and that bit is set, then *iter
will return 4.
References libecc::bitset_index::M_index.
bitset_iterator< N, DIRECTION > libecc::bitset_iterator< N, DIRECTION >::operator++ | ( | int | ) | [inline] |
Postincrement.
References libecc::bitset_index_iterator< DIRECTION >::increment().
bitset_iterator< N, DIRECTION > & libecc::bitset_iterator< N, DIRECTION >::operator++ | ( | ) | [inline] |
Preincrement.
References libecc::bitset_index_iterator< DIRECTION >::increment().
bitset_iterator< N, DIRECTION > & libecc::bitset_iterator< N, DIRECTION >::operator+= | ( | int | n | ) | [inline] |
Iterator addition.
References libecc::bitset_index_iterator< DIRECTION >::increment().
bitset_iterator< N, DIRECTION > libecc::bitset_iterator< N, DIRECTION >::operator-- | ( | int | ) | [inline] |
Postdecrement.
References libecc::bitset_index_iterator< DIRECTION >::decrement().
bitset_iterator< N, DIRECTION > & libecc::bitset_iterator< N, DIRECTION >::operator-- | ( | ) | [inline] |
Predecrement.
References libecc::bitset_index_iterator< DIRECTION >::decrement().
bitset_iterator< N, DIRECTION > & libecc::bitset_iterator< N, DIRECTION >::operator-= | ( | int | n | ) | [inline] |
Iterator subtraction.
References libecc::bitset_index_iterator< DIRECTION >::decrement().
bitset_iterator< N, DIRECTION > & libecc::bitset_iterator< N, DIRECTION >::operator= | ( | bitset_iterator< N, DIRECTION > const & | iter | ) | [inline] |
Assignment operator.
References libecc::bitset_index::M_index.
bitset_digit_t libecc::bitset_iterator< N, DIRECTION >::operator[] | ( | int | n | ) | const [inline] |
Element operator.
bitset_iterator operator+ | ( | bitset_iterator< N, DIRECTION > const & | i, | |
int | n | |||
) | [friend] |
Iterator addition.
bitset_iterator operator+ | ( | int | n, | |
bitset_iterator< N, DIRECTION > const & | i | |||
) | [friend] |
Iterator addition.
bitset_iterator operator- | ( | bitset_iterator< N, DIRECTION > const & | i, | |
int | n | |||
) | [friend] |
Iterator subtraction.
bitset_iterator operator- | ( | int | n, | |
bitset_iterator< N, DIRECTION > const & | i | |||
) | [friend] |
Iterator subtraction.