KJB
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
kjb::circular_iterator< iterator > Class Template Reference

#include <l_iterator.h>

Inheritance diagram for kjb::circular_iterator< iterator >:

Public Types

typedef std::iterator_traits
< iterator >::value_type 
value_type
 

Public Member Functions

 circular_iterator ()
 
 circular_iterator (iterator b, iterator e)
 
 circular_iterator (const circular_iterator &other)
 
 circular_iterator (Self &other)
 
template<class Container_ >
 circular_iterator (Container_ &c)
 
Selfoperator= (const Self &other)
 
const iterator & get_iterator () const
 
void swap (Self &other)
 
Selfoperator-- ()
 
Self operator-- (int)
 
Selfoperator++ ()
 
Self operator++ (int)
 
value_typeoperator* () const
 
value_typeoperator-> () const
 
bool operator== (const Self &rhs) const
 
bool operator== (const iterator &rhs) const
 
bool operator!= (const Self &rhs) const
 
bool operator!= (const iterator &rhs) const
 
void reset ()
 

Protected Attributes

iterator begin
 
iterator end
 
iterator iter
 

Detailed Description

template<class iterator>
class kjb::circular_iterator< iterator >

An very simple iterator that continues at the beginning when it reaches the end. This is useful when you need to cycle through elements of a collection by avoiding messy modulo operations when stepping backward.

Note
You should NOT pass this to any algorithm that expects the iterator to eventally end. This iterator would appear to represent and infinitely long array that repeats every N elements.
Author
Kyle Simek
See Also
const_circular_iterator

Member Typedef Documentation

template<class iterator>
typedef std::iterator_traits<iterator>::value_type kjb::circular_iterator< iterator >::value_type

Constructor & Destructor Documentation

template<class iterator>
kjb::circular_iterator< iterator >::circular_iterator ( )
inline
template<class iterator>
kjb::circular_iterator< iterator >::circular_iterator ( iterator  b,
iterator  e 
)
inline
template<class iterator>
kjb::circular_iterator< iterator >::circular_iterator ( const circular_iterator< iterator > &  other)
inline
template<class iterator>
kjb::circular_iterator< iterator >::circular_iterator ( Self other)
inline
template<class iterator>
template<class Container_ >
kjb::circular_iterator< iterator >::circular_iterator ( Container_ &  c)
inlineexplicit

Member Function Documentation

template<class iterator>
const iterator& kjb::circular_iterator< iterator >::get_iterator ( ) const
inline
template<class iterator>
bool kjb::circular_iterator< iterator >::operator!= ( const Self rhs) const
inline
template<class iterator>
bool kjb::circular_iterator< iterator >::operator!= ( const iterator &  rhs) const
inline
template<class iterator>
value_type& kjb::circular_iterator< iterator >::operator* ( ) const
inline
template<class iterator>
Self& kjb::circular_iterator< iterator >::operator++ ( )
inline
template<class iterator>
Self kjb::circular_iterator< iterator >::operator++ ( int  )
inline
template<class iterator>
Self& kjb::circular_iterator< iterator >::operator-- ( )
inline
template<class iterator>
Self kjb::circular_iterator< iterator >::operator-- ( int  )
inline
template<class iterator>
value_type* kjb::circular_iterator< iterator >::operator-> ( ) const
inline
template<class iterator>
Self& kjb::circular_iterator< iterator >::operator= ( const Self other)
inline
template<class iterator>
bool kjb::circular_iterator< iterator >::operator== ( const Self rhs) const
inline
template<class iterator>
bool kjb::circular_iterator< iterator >::operator== ( const iterator &  rhs) const
inline
template<class iterator>
void kjb::circular_iterator< iterator >::reset ( )
inline
template<class iterator>
void kjb::circular_iterator< iterator >::swap ( Self other)
inline

Member Data Documentation

template<class iterator>
iterator kjb::circular_iterator< iterator >::begin
protected
template<class iterator>
iterator kjb::circular_iterator< iterator >::end
protected
template<class iterator>
iterator kjb::circular_iterator< iterator >::iter
protected

The documentation for this class was generated from the following file: