A bitset index. More...
#include <libecc/bitset.h>
Public Member Functions | |
int | get_index (void) const |
Protected Member Functions | |
void | left (void) |
Move one bit left in the bitset. | |
void | right (void) |
Move one bit right in the bitset. | |
void | left (int n) |
Move n bits left in the bitset. | |
void | right (int n) |
Move n bits right in the bitset. | |
bitset_index (void) | |
Construct an uninitialized bitset index. | |
bitset_index (bitset_index const &index) | |
Copy constructor. | |
bitset_index (int bit) | |
Construct a bitset index that points to bit number bit. | |
Protected Attributes | |
int | M_index |
The bit number that this index points to. | |
Friends | |
bool | operator== (bitset_index const &i1, bitset_index const &i2) |
Equality operator. | |
bool | operator!= (bitset_index const &i1, bitset_index const &i2) |
Inequality operator. |
A bitset index.
This class represents a bit index, the distance between the bit refered to and the least significant bit. It does not specify which bitset instance or even the size of the bitset. The index can contain positive and negative values, an offset of -1 represents the singular 'rend()' const_reverse_iterator. Using an index that is too large or too small for the bitset that it is being used with will leads to undefined behaviour.
libecc::bitset_index::bitset_index | ( | void | ) | [inline, protected] |
Construct an uninitialized bitset index.
libecc::bitset_index::bitset_index | ( | bitset_index const & | index | ) | [inline, protected] |
Copy constructor.
libecc::bitset_index::bitset_index | ( | int | bit | ) | [inline, protected] |
int libecc::bitset_index::get_index | ( | void | ) | const [inline] |
Accessor for the current bit index.
References M_index.
Referenced by libecc::bitset_base< N >::clear(), libecc::bitset_base< N >::flip(), libecc::bitset_base< N >::set(), and libecc::bitset_base< N >::test().
void libecc::bitset_index::left | ( | void | ) | [inline, protected] |
Move one bit left in the bitset.
References M_index.
Referenced by libecc::bitset_index_iterator< DIRECTION >::decrement(), and libecc::bitset_index_iterator< DIRECTION >::increment().
void libecc::bitset_index::left | ( | int | n | ) | [inline, protected] |
Move n bits left in the bitset.
References M_index.
void libecc::bitset_index::right | ( | void | ) | [inline, protected] |
Move one bit right in the bitset.
References M_index.
Referenced by libecc::bitset_index_iterator< DIRECTION >::decrement(), and libecc::bitset_index_iterator< DIRECTION >::increment().
void libecc::bitset_index::right | ( | int | n | ) | [inline, protected] |
Move n bits right in the bitset.
References M_index.
bool operator!= | ( | bitset_index const & | i1, | |
bitset_index const & | i2 | |||
) | [friend] |
Inequality operator.
bool operator== | ( | bitset_index const & | i1, | |
bitset_index const & | i2 | |||
) | [friend] |
Equality operator.
int libecc::bitset_index::M_index [protected] |
The bit number that this index points to.
Referenced by libecc::bitset_iterator< N, DIRECTION >::find1(), get_index(), left(), libecc::operator!=(), libecc::bitset_iterator< N, DIRECTION >::operator*(), libecc::bitset_iterator< N, DIRECTION >::operator=(), libecc::operator==(), libecc::operator>(), libecc::operator>=(), and right().