Loading...
Searching...
No Matches
CirculatorIters< Container, Const > Class Template Reference

A pair of begin/end iterators used for implementing circular iteration. More...

#include <Circulator.H>

Inheritance diagram for CirculatorIters< Container, Const >:
Collaboration diagram for CirculatorIters< Container, Const >:

Public Types

using size_type = typename Container::size_type
 The type that can represent the size of Container.
using difference_type = typename Container::difference_type
 The type that represents difference between iterator objects.
using iterator
 The container iterator type (const/non-const).
using reference
 The reference type (const/non-const).
Public Types inherited from CirculatorBase
enum  direction { NONE , CLOCKWISE , ANTICLOCKWISE }
 Direction type enumeration. More...

Public Member Functions

 CirculatorIters ()
 Default construct.
 CirculatorIters (const iterator &begin, const iterator &end)
 Construct from begin/end iterators.
 CirculatorIters (const CirculatorIters< Container, Const > &rhs)
 Copy construct.
bool empty () const
 True if begin/end iterators are identical.
size_type size () const
 Return the range of the iterator pair.
difference_type nRotations () const
 The distance between the iterator and the fulcrum.
bool circulate (const CirculatorBase::direction dir=CirculatorBase::NONE)
 Circulate around the list in the given direction.
void setFulcrumToIterator ()
 Set the fulcrum to the current position of the iterator.
void setIteratorToFulcrum ()
 Set the iterator to the current position of the fulcrum.
reference curr () const
 Dereference the current iterator.
reference next () const
 Dereference the next iterator.
reference prev () const
 Dereference the previous iterator.
void operator= (const CirculatorIters< Container, Const > &rhs)
 Assignment operator for circulators operating on the same container type.
CirculatorIters< Container, Const > & operator++ ()
 Prefix increment the iterator.
CirculatorIters< Container, Const > operator++ (int)
 Postfix increment the iterator.
CirculatorIters< Container, Const > & operator-- ()
 Prefix decrement the iterator.
CirculatorIters< Container, Const > operator-- (int)
 Postfix decrement the iterator.
bool operator== (const CirculatorIters< Container, Const > &) const
 Check for equality of this iterator with another iterator that operate on the same container type.
bool operator!= (const CirculatorIters< Container, Const > &) const
 Check for inequality of this iterator with another iterator that operate on the same container type.
reference operator* () const
 Dereference the iterator. Same as curr().
reference operator() () const
 Dereference the iterator. Same as curr().
difference_type operator- (const CirculatorIters< Container, Const > &) const
 Return the difference between this iterator and another iterator that operate on the same container type.
Public Member Functions inherited from CirculatorBase
 CirculatorBase ()=default
 Default construct.

Protected Member Functions

bool equal (const CirculatorIters< Container, Const > &rhs)
 Compare for equality.
void increment ()
 Move iterator forward.
void decrement ()
 Move iterator backward.

Detailed Description

template<class Container, bool Const>
class Foam::CirculatorIters< Container, Const >

A pair of begin/end iterators used for implementing circular iteration.

Definition at line 111 of file Circulator.H.

Member Typedef Documentation

◆ size_type

template<class Container, bool Const>
using size_type = typename Container::size_type

The type that can represent the size of Container.

Definition at line 122 of file Circulator.H.

◆ difference_type

template<class Container, bool Const>
using difference_type = typename Container::difference_type

The type that represents difference between iterator objects.

Definition at line 127 of file Circulator.H.

◆ iterator

template<class Container, bool Const>
using iterator
Initial value:
std::conditional_t
<
Const,
typename Container::const_iterator,
typename Container::iterator
>

The container iterator type (const/non-const).

Definition at line 132 of file Circulator.H.

◆ reference

template<class Container, bool Const>
using reference
Initial value:
std::conditional_t
<
Const,
typename Container::const_reference,
typename Container::reference
>

The reference type (const/non-const).

Definition at line 142 of file Circulator.H.

Constructor & Destructor Documentation

◆ CirculatorIters() [1/3]

template<class Container, bool Const>
CirculatorIters ( )
inline

Default construct.

Definition at line 66 of file CirculatorI.H.

Referenced by CirculatorIters(), equal(), operator-(), operator=(), and operator==().

Here is the caller graph for this function:

◆ CirculatorIters() [2/3]

template<class Container, bool Const>
CirculatorIters ( const iterator & begin,
const iterator & end )
inline

Construct from begin/end iterators.

Definition at line 76 of file CirculatorI.H.

◆ CirculatorIters() [3/3]

template<class Container, bool Const>
CirculatorIters ( const CirculatorIters< Container, Const > & rhs)

Copy construct.

Definition at line 90 of file CirculatorI.H.

References CirculatorIters(), and Foam::rhs().

Here is the call graph for this function:

Member Function Documentation

◆ equal()

template<class Container, bool Const>
bool equal ( const CirculatorIters< Container, Const > & rhs)
inlineprotected

Compare for equality.

Definition at line 25 of file CirculatorI.H.

References CirculatorIters(), and Foam::rhs().

Here is the call graph for this function:

◆ increment()

template<class Container, bool Const>
void increment ( )
inlineprotected

Move iterator forward.

Definition at line 41 of file CirculatorI.H.

Referenced by circulate(), and operator++().

Here is the caller graph for this function:

◆ decrement()

template<class Container, bool Const>
void decrement ( )
inlineprotected

Move iterator backward.

Definition at line 52 of file CirculatorI.H.

Referenced by circulate(), operator--(), and operator--().

Here is the caller graph for this function:

◆ empty()

template<class Container, bool Const>
bool empty ( ) const
inline

True if begin/end iterators are identical.

Definition at line 105 of file CirculatorI.H.

◆ size()

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const >::size_type size ( ) const
inline

Return the range of the iterator pair.

Definition at line 113 of file CirculatorI.H.

◆ nRotations()

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const >::difference_type nRotations ( ) const
inline

The distance between the iterator and the fulcrum.

This is equivalent to the number of rotations of the circulator

Definition at line 121 of file CirculatorI.H.

◆ circulate()

template<class Container, bool Const>
bool circulate ( const CirculatorBase::direction dir = CirculatorBase::NONE)
inline

Circulate around the list in the given direction.

Returns
True if iterator has not yet reached the fulcrum

Definition at line 128 of file CirculatorI.H.

References CirculatorBase::ANTICLOCKWISE, CirculatorBase::CLOCKWISE, decrement(), and increment().

Referenced by face::compare(), and processorPolyPatch::matchFace().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setFulcrumToIterator()

template<class Container, bool Const>
void setFulcrumToIterator ( )
inline

Set the fulcrum to the current position of the iterator.

Definition at line 147 of file CirculatorI.H.

Referenced by face::compare(), and processorPolyPatch::matchFace().

Here is the caller graph for this function:

◆ setIteratorToFulcrum()

template<class Container, bool Const>
void setIteratorToFulcrum ( )
inline

Set the iterator to the current position of the fulcrum.

Definition at line 154 of file CirculatorI.H.

Referenced by face::compare(), and processorPolyPatch::matchFace().

Here is the caller graph for this function:

◆ curr()

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const >::reference curr ( ) const
inline

Dereference the current iterator.

Definition at line 162 of file CirculatorI.H.

◆ next()

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const >::reference next ( ) const
inline

Dereference the next iterator.

Definition at line 170 of file CirculatorI.H.

◆ prev()

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const >::reference prev ( ) const
inline

Dereference the previous iterator.

Definition at line 183 of file CirculatorI.H.

◆ operator=()

template<class Container, bool Const>
void operator= ( const CirculatorIters< Container, Const > & rhs)
inline

Assignment operator for circulators operating on the same container type.

Definition at line 197 of file CirculatorI.H.

References CirculatorIters(), and Foam::rhs().

Here is the call graph for this function:

◆ operator++() [1/2]

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const > & operator++ ( )
inline

Prefix increment the iterator.

Wraps iterator to the begin if it reaches the end

Definition at line 216 of file CirculatorI.H.

References increment().

Here is the call graph for this function:

◆ operator++() [2/2]

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const > operator++ ( int )
inline

Postfix increment the iterator.

Wraps iterator to the begin if it reaches the end

Definition at line 225 of file CirculatorI.H.

◆ operator--() [1/2]

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const > & operator-- ( )
inline

Prefix decrement the iterator.

Wraps iterator to the end if it reaches the beginning

Definition at line 235 of file CirculatorI.H.

References decrement().

Here is the call graph for this function:

◆ operator--() [2/2]

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const > operator-- ( int )
inline

Postfix decrement the iterator.

Wraps iterator to the end if it reaches the beginning

Definition at line 244 of file CirculatorI.H.

References decrement().

Here is the call graph for this function:

◆ operator==()

template<class Container, bool Const>
bool operator== ( const CirculatorIters< Container, Const > & rhs) const
inline

Check for equality of this iterator with another iterator that operate on the same container type.

Definition at line 253 of file CirculatorI.H.

References CirculatorIters(), and Foam::rhs().

Here is the call graph for this function:

◆ operator!=()

template<class Container, bool Const>
bool operator!= ( const CirculatorIters< Container, Const > & rhs) const
inline

Check for inequality of this iterator with another iterator that operate on the same container type.

Definition at line 263 of file CirculatorI.H.

◆ operator*()

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const >::reference operator* ( ) const
inline

Dereference the iterator. Same as curr().

Definition at line 274 of file CirculatorI.H.

◆ operator()()

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const >::reference operator() ( ) const
inline

Dereference the iterator. Same as curr().

Definition at line 282 of file CirculatorI.H.

◆ operator-()

template<class Container, bool Const>
Foam::CirculatorIters< Container, Const >::difference_type operator- ( const CirculatorIters< Container, Const > & rhs) const
inline

Return the difference between this iterator and another iterator that operate on the same container type.

Definition at line 290 of file CirculatorI.H.

References CirculatorIters(), and Foam::rhs().

Here is the call graph for this function:

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