Walks over a container as if it were circular. The container must have the following members defined: More...
Public Types | |
typedef ContainerType::value_type | value_type |
Type of values ContainerType contains. More... | |
typedef ContainerType::size_type | size_type |
The type that can represent the size of ContainerType. More... | |
typedef ContainerType::difference_type | difference_type |
The type that can represent the difference between any two. More... | |
typedef ContainerType::const_iterator | const_iterator |
Random access iterator for traversing ContainerType. More... | |
typedef ContainerType::const_reference | const_reference |
Type that can be used for storing into. More... | |
Public Types inherited from CirculatorBase | |
enum | direction { none, clockwise, anticlockwise } |
Direction type enumeration. More... | |
Public Member Functions | |
ConstCirculator () | |
Construct null. More... | |
ConstCirculator (const ContainerType &container) | |
Construct from a container. More... | |
ConstCirculator (const const_iterator &begin, const const_iterator &end) | |
Construct from two iterators. More... | |
ConstCirculator (const ConstCirculator< ContainerType > &) | |
Copy constructor. More... | |
~ConstCirculator () | |
Destructor. More... | |
size_type | size () const |
Return the range of the iterator. More... | |
bool | circulate (const CirculatorBase::direction dir=CirculatorBase::direction::none) |
Circulate around the list in the given direction. More... | |
void | setFulcrumToIterator () |
Set the fulcrum to the current position of the iterator. More... | |
void | setIteratorToFulcrum () |
Set the iterator to the current position of the fulcrum. More... | |
difference_type | nRotations () const |
Return the distance between the iterator and the fulcrum. This is. More... | |
const_reference | next () const |
Dereference the next iterator and return. More... | |
const_reference | prev () const |
Dereference the previous iterator and return. More... | |
void | operator= (const ConstCirculator< ContainerType > &) |
Assignment operator for circulators that operate on the same. More... | |
ConstCirculator< ContainerType > & | operator++ () |
Prefix increment. Increments the iterator. More... | |
ConstCirculator< ContainerType > | operator++ (int) |
Postfix increment. Increments the iterator. More... | |
ConstCirculator< ContainerType > & | operator-- () |
Prefix decrement. Decrements the iterator. More... | |
ConstCirculator< ContainerType > | operator-- (int) |
Postfix decrement. Decrements the iterator. More... | |
bool | operator== (const ConstCirculator< ContainerType > &c) const |
Check for equality of this iterator with another iterator that. More... | |
bool | operator!= (const ConstCirculator< ContainerType > &c) const |
Check for inequality of this iterator with another iterator that. More... | |
const_reference | operator* () const |
Dereference the iterator and return. More... | |
const_reference | operator() () const |
Dereference the iterator and return. More... | |
difference_type | operator- (const ConstCirculator< ContainerType > &c) const |
Return the difference between this iterator and another iterator. More... | |
Public Member Functions inherited from CirculatorBase | |
CirculatorBase () | |
Construct null. More... | |
Protected Attributes | |
ContainerType::const_iterator | begin_ |
Iterator pointing to the beginning of the container. More... | |
ContainerType::const_iterator | end_ |
Iterator pointing to the end of the container. More... | |
ContainerType::const_iterator | iter_ |
Iterator. More... | |
ContainerType::const_iterator | fulcrum_ |
Iterator holding the location of the fulcrum (start and end) of. More... | |
Walks over a container as if it were circular. The container must have the following members defined:
Examples:
Definition at line 94 of file ConstCirculator.H.
typedef ContainerType::value_type value_type |
Type of values ContainerType contains.
Definition at line 123 of file ConstCirculator.H.
typedef ContainerType::size_type size_type |
The type that can represent the size of ContainerType.
Definition at line 126 of file ConstCirculator.H.
typedef ContainerType::difference_type difference_type |
The type that can represent the difference between any two.
iterator objects.
Definition at line 130 of file ConstCirculator.H.
typedef ContainerType::const_iterator const_iterator |
Random access iterator for traversing ContainerType.
Definition at line 133 of file ConstCirculator.H.
typedef ContainerType::const_reference const_reference |
Type that can be used for storing into.
const ContainerType::value_type objects.
Definition at line 137 of file ConstCirculator.H.
|
inline |
Construct null.
Definition at line 29 of file ConstCirculatorI.H.
Referenced by ConstCirculator< ContainerType >::ConstCirculator().
|
inlineexplicit |
Construct from a container.
Definition at line 41 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::ConstCirculator().
|
inline |
Construct from two iterators.
Definition at line 55 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::ConstCirculator().
|
inline |
Copy constructor.
Definition at line 70 of file ConstCirculatorI.H.
~ConstCirculator | ( | ) |
Destructor.
Definition at line 85 of file ConstCirculatorI.H.
|
inline |
Return the range of the iterator.
Definition at line 93 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::begin_, ConstCirculator< ContainerType >::circulate(), and ConstCirculator< ContainerType >::end_.
|
inline |
Circulate around the list in the given direction.
Definition at line 101 of file ConstCirculatorI.H.
References CirculatorBase::anticlockwise, CirculatorBase::clockwise, ConstCirculator< ContainerType >::fulcrum_, ConstCirculator< ContainerType >::iter_, ConstCirculator< ContainerType >::operator++(), and ConstCirculator< ContainerType >::operator--().
Referenced by face::compare(), and ConstCirculator< ContainerType >::size().
|
inline |
Set the fulcrum to the current position of the iterator.
Definition at line 119 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::fulcrum_, and ConstCirculator< ContainerType >::iter_.
Referenced by face::compare().
|
inline |
Set the iterator to the current position of the fulcrum.
Definition at line 126 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::fulcrum_, and ConstCirculator< ContainerType >::iter_.
Referenced by face::compare().
|
inline |
Return the distance between the iterator and the fulcrum. This is.
equivalent to the number of rotations of the circulator.
Definition at line 134 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::fulcrum_, and ConstCirculator< ContainerType >::iter_.
|
inline |
Dereference the next iterator and return.
Definition at line 142 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::begin_, ConstCirculator< ContainerType >::end_, and ConstCirculator< ContainerType >::iter_.
|
inline |
Dereference the previous iterator and return.
Definition at line 155 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::begin_, ConstCirculator< ContainerType >::end_, and ConstCirculator< ContainerType >::iter_.
|
inline |
Assignment operator for circulators that operate on the same.
container type
Definition at line 170 of file ConstCirculatorI.H.
References Foam::abort(), ConstCirculator< ContainerType >::begin_, ConstCirculator< ContainerType >::end_, Foam::FatalError, FatalErrorInFunction, ConstCirculator< ContainerType >::fulcrum_, and ConstCirculator< ContainerType >::iter_.
|
inline |
Prefix increment. Increments the iterator.
Sets the iterator to the beginning of the container if it reaches the end
Definition at line 191 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::begin_, ConstCirculator< ContainerType >::end_, and ConstCirculator< ContainerType >::iter_.
Referenced by ConstCirculator< ContainerType >::circulate().
|
inline |
Postfix increment. Increments the iterator.
Sets the iterator to the beginning of the container if it reaches the end
Definition at line 205 of file ConstCirculatorI.H.
|
inline |
Prefix decrement. Decrements the iterator.
Sets the iterator to the end of the container if it reaches the beginning
Definition at line 215 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::begin_, ConstCirculator< ContainerType >::end_, and ConstCirculator< ContainerType >::iter_.
Referenced by ConstCirculator< ContainerType >::circulate().
|
inline |
Postfix decrement. Decrements the iterator.
Sets the iterator to the end of the container if it reaches the beginning
Definition at line 229 of file ConstCirculatorI.H.
|
inline |
Check for equality of this iterator with another iterator that.
operate on the same container type
Definition at line 239 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::begin_, Foam::constant::universal::c, ConstCirculator< ContainerType >::end_, ConstCirculator< ContainerType >::fulcrum_, and ConstCirculator< ContainerType >::iter_.
|
inline |
Check for inequality of this iterator with another iterator that.
operate on the same container type
Definition at line 255 of file ConstCirculatorI.H.
References Foam::constant::universal::c.
|
inline |
Dereference the iterator and return.
Definition at line 265 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::iter_.
Referenced by ConstCirculator< ContainerType >::operator()().
|
inline |
Dereference the iterator and return.
Definition at line 273 of file ConstCirculatorI.H.
References ConstCirculator< ContainerType >::operator*().
|
inline |
Return the difference between this iterator and another iterator.
that operate on the same container type
Definition at line 282 of file ConstCirculatorI.H.
References Foam::constant::universal::c, and ConstCirculator< ContainerType >::iter_.
|
protected |
Iterator pointing to the beginning of the container.
Definition at line 104 of file ConstCirculator.H.
Referenced by ConstCirculator< ContainerType >::next(), ConstCirculator< ContainerType >::operator++(), ConstCirculator< ContainerType >::operator--(), ConstCirculator< ContainerType >::operator=(), ConstCirculator< ContainerType >::operator==(), ConstCirculator< ContainerType >::prev(), and ConstCirculator< ContainerType >::size().
|
protected |
Iterator pointing to the end of the container.
Definition at line 107 of file ConstCirculator.H.
Referenced by ConstCirculator< ContainerType >::next(), ConstCirculator< ContainerType >::operator++(), ConstCirculator< ContainerType >::operator--(), ConstCirculator< ContainerType >::operator=(), ConstCirculator< ContainerType >::operator==(), ConstCirculator< ContainerType >::prev(), and ConstCirculator< ContainerType >::size().
|
protected |
Iterator.
Definition at line 110 of file ConstCirculator.H.
Referenced by ConstCirculator< ContainerType >::circulate(), ConstCirculator< ContainerType >::next(), ConstCirculator< ContainerType >::nRotations(), ConstCirculator< ContainerType >::operator*(), ConstCirculator< ContainerType >::operator++(), ConstCirculator< ContainerType >::operator-(), ConstCirculator< ContainerType >::operator--(), ConstCirculator< ContainerType >::operator=(), ConstCirculator< ContainerType >::operator==(), ConstCirculator< ContainerType >::prev(), ConstCirculator< ContainerType >::setFulcrumToIterator(), and ConstCirculator< ContainerType >::setIteratorToFulcrum().
|
protected |
Iterator holding the location of the fulcrum (start and end) of.
the container. Used to decide when the iterator should stop circulating over the container
Definition at line 115 of file ConstCirculator.H.
Referenced by ConstCirculator< ContainerType >::circulate(), ConstCirculator< ContainerType >::nRotations(), ConstCirculator< ContainerType >::operator=(), ConstCirculator< ContainerType >::operator==(), ConstCirculator< ContainerType >::setFulcrumToIterator(), and ConstCirculator< ContainerType >::setIteratorToFulcrum().