Cortex  10.0.0-a4
Public Types | Public Member Functions | List of all members
IECore::CircularIterator< Iterator, Container > Class Template Reference

#include <CircularIterator.h>

Public Types

typedef Iterator BaseIterator
 
typedef BaseIterator::pointer pointer
 
typedef BaseIterator::reference reference
 
typedef BaseIterator::value_type value_type
 

Public Member Functions

 CircularIterator ()
 Uninitialised.
 
 CircularIterator (BaseIterator begin, BaseIterator end)
 
 CircularIterator (BaseIterator begin, BaseIterator end, BaseIterator position)
 As above but starts iteration at position.
 
 CircularIterator (Container *container)
 
 CircularIterator (Container *container, BaseIterator position)
 As above but starts iteration at position.
 
CircularIteratoroperator++ ()
 
CircularIterator operator++ (int)
 
reference operator* () const
 
pointer operator-> () const
 
bool operator== (const CircularIterator &rhs) const
 
bool operator== (const BaseIterator &rhs) const
 
bool operator!= (const CircularIterator &rhs) const
 
bool operator!= (const BaseIterator &rhs) const
 
 operator BaseIterator () const
 
CircularIteratoroperator= (const BaseIterator &rhs)
 

Detailed Description

template<typename Iterator, typename Container = void>
class IECore::CircularIterator< Iterator, Container >

The CircularIterator class provides a means of iterating endlessly around a range, cycling back to the beginning once the range is reached. It's simplest instantiation specifies only on an Iterator type, in which case the range may only be specified with begin and end iterators passed to a constructor. Alternatively a Container type may be specified as well, in which case the range may be specified by evaluating the beginning and end of the container whenever needed - this form is of use when items will be removed from the container during iteration.

Constructor & Destructor Documentation

template<typename Iterator , typename Container = void>
IECore::CircularIterator< Iterator, Container >::CircularIterator ( BaseIterator  begin,
BaseIterator  end 
)

Iteration cycles the range between begin and end, not including end. Iteration starts at begin. If begin or end become invalid during iteration then behaviour is undefined.

template<typename Iterator , typename Container = void>
IECore::CircularIterator< Iterator, Container >::CircularIterator ( Container *  container)

Iterates over the range container->begin(), container->end(). These values are evaluated whenever used, so iterators may be removed from the container provided the current iterator remains valid. Only available if the Container type is not void.


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