Cortex
10.0.0-a4
|
#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. | |
CircularIterator & | operator++ () |
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 | |
CircularIterator & | operator= (const BaseIterator &rhs) |
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.
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.
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.