Main Page   Reference Manual   Compound List   File List  

libecc::bitset_iterator< N, DIRECTION > Class Template Reference

A non-mutable bitset-iterator. More...

#include <libecc/bitset.h>

Inheritance diagram for libecc::bitset_iterator< N, DIRECTION >:
Collaboration diagram for libecc::bitset_iterator< N, DIRECTION >:

List of all members.

Public Member Functions

 bitset_iterator (void)
 Construct uninitialized bitset iterator.
 bitset_iterator (bitset_iterator const &iter)
 Copy constructor.
bitset_iteratoroperator= (bitset_iterator const &iter)
 Assignment operator.
bitset_digit_t operator* () const
 Access bit as zero or bitmask.
bitset_iteratoroperator++ ()
 Preincrement.
bitset_iterator operator++ (int)
 Postincrement.
bitset_iteratoroperator-- ()
 Predecrement.
bitset_iterator operator-- (int)
 Postdecrement.
bitset_iteratoroperator+= (int n)
 Iterator addition.
bitset_iteratoroperator-= (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.

Detailed Description

template<unsigned int N, int DIRECTION>
class libecc::bitset_iterator< N, DIRECTION >

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.


Constructor & Destructor Documentation

template<unsigned int N, int DIRECTION>
libecc::bitset_iterator< N, DIRECTION >::bitset_iterator ( void   )  [inline]

Construct uninitialized bitset iterator.

template<unsigned int N, int DIRECTION>
libecc::bitset_iterator< N, DIRECTION >::bitset_iterator ( bitset_iterator< N, DIRECTION > const &  iter  )  [inline]

Copy constructor.

template<unsigned int N, int DIRECTION>
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.


Member Function Documentation

template<unsigned int N, int DIRECTION>
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.

template<unsigned int N, int DIRECTION>
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.

template<unsigned int N, int DIRECTION>
bitset_iterator< N, DIRECTION > libecc::bitset_iterator< N, DIRECTION >::operator++ ( int   )  [inline]
template<unsigned int N, int DIRECTION>
bitset_iterator< N, DIRECTION > & libecc::bitset_iterator< N, DIRECTION >::operator++ (  )  [inline]
template<unsigned int N, int DIRECTION>
bitset_iterator< N, DIRECTION > & libecc::bitset_iterator< N, DIRECTION >::operator+= ( int  n  )  [inline]
template<unsigned int N, int DIRECTION>
bitset_iterator< N, DIRECTION > libecc::bitset_iterator< N, DIRECTION >::operator-- ( int   )  [inline]
template<unsigned int N, int DIRECTION>
bitset_iterator< N, DIRECTION > & libecc::bitset_iterator< N, DIRECTION >::operator-- (  )  [inline]
template<unsigned int N, int DIRECTION>
bitset_iterator< N, DIRECTION > & libecc::bitset_iterator< N, DIRECTION >::operator-= ( int  n  )  [inline]
template<unsigned int N, int DIRECTION>
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.

template<unsigned int N, int DIRECTION>
bitset_digit_t libecc::bitset_iterator< N, DIRECTION >::operator[] ( int  n  )  const [inline]

Element operator.


Friends And Related Function Documentation

template<unsigned int N, int DIRECTION>
bitset_iterator operator+ ( bitset_iterator< N, DIRECTION > const &  i,
int  n 
) [friend]

Iterator addition.

template<unsigned int N, int DIRECTION>
bitset_iterator operator+ ( int  n,
bitset_iterator< N, DIRECTION > const &  i 
) [friend]

Iterator addition.

template<unsigned int N, int DIRECTION>
bitset_iterator operator- ( bitset_iterator< N, DIRECTION > const &  i,
int  n 
) [friend]

Iterator subtraction.

template<unsigned int N, int DIRECTION>
bitset_iterator operator- ( int  n,
bitset_iterator< N, DIRECTION > const &  i 
) [friend]

Iterator subtraction.

Copyright © 2002-2008 Carlo Wood.  All rights reserved.