Public Types | Public Member Functions | Protected Attributes | List of all members
ConstCirculator< ContainerType > Class Template Reference

Walks over a container as if it were circular. The container must have the following members defined: More...

Inheritance diagram for ConstCirculator< ContainerType >:
Inheritance graph
[legend]
Collaboration diagram for ConstCirculator< ContainerType >:
Collaboration graph
[legend]

Public Types

typedef ContainerType::value_type value_type
 
typedef ContainerType::size_type size_type
 
typedef ContainerType::difference_type difference_type
 
typedef ContainerType::const_iterator const_iterator
 
typedef ContainerType::const_reference const_reference
 
- Public Types inherited from CirculatorBase
enum  direction { NONE, CLOCKWISE, ANTICLOCKWISE }
 

Public Member Functions

 ConstCirculator ()
 
 ConstCirculator (const ContainerType &container)
 
 ConstCirculator (const const_iterator &begin, const const_iterator &end)
 
 ConstCirculator (const ConstCirculator< ContainerType > &)
 
 ~ConstCirculator ()
 
size_type size () const
 
bool circulate (const CirculatorBase::direction dir=NONE)
 
void setFulcrumToIterator ()
 
void setIteratorToFulcrum ()
 
difference_type nRotations () const
 
const_reference next () const
 
const_reference prev () const
 
void operator= (const ConstCirculator< ContainerType > &)
 
ConstCirculator< ContainerType > & operator++ ()
 
ConstCirculator< ContainerType > operator++ (int)
 
ConstCirculator< ContainerType > & operator-- ()
 
ConstCirculator< ContainerType > operator-- (int)
 
bool operator== (const ConstCirculator< ContainerType > &c) const
 
bool operator!= (const ConstCirculator< ContainerType > &c) const
 
const_reference operator* () const
 
const_reference operator() () const
 
difference_type operator- (const ConstCirculator< ContainerType > &c) const
 
- Public Member Functions inherited from CirculatorBase
 CirculatorBase ()
 

Protected Attributes

ContainerType::const_iterator begin_
 
ContainerType::const_iterator end_
 
ContainerType::const_iterator iter_
 
ContainerType::const_iterator fulcrum_
 

Detailed Description

template<class ContainerType>
class Foam::ConstCirculator< ContainerType >

Walks over a container as if it were circular. The container must have the following members defined:

Examples:

face f(identity(5));
// Construct circulator from the face
ConstCirculator<face> circ(f);
// First check that the circulator has a size to iterate over.
// Then circulate around the list starting and finishing at the fulcrum.
if (circ.size()) do
{
Info<< "Iterate forwards over face : " << circ() << endl;
} while (circ.circulate(CirculatorBase::CLOCKWISE));
face f(identity(5));
ConstCirculator<face> circClockwise(f);
ConstCirculator<face> circAnticlockwise(f);
if (circClockwise.size() && circAnticlockwise.size()) do
{
Info<< "Iterate forward over face :" << circClockwise() << endl;
Info<< "Iterate backward over face:" << circAnticlockwise() << endl;
}
while
(
circClockwise.circulate(CirculatorBase::CLOCKWISE),
circAnticlockwise.circulate(CirculatorBase::ANTICLOCKWISE)
);
Source files

Definition at line 89 of file ConstCirculator.H.

Member Typedef Documentation

◆ value_type

typedef ContainerType::value_type value_type

Definition at line 118 of file ConstCirculator.H.

◆ size_type

typedef ContainerType::size_type size_type

Definition at line 121 of file ConstCirculator.H.

◆ difference_type

typedef ContainerType::difference_type difference_type

Definition at line 125 of file ConstCirculator.H.

◆ const_iterator

typedef ContainerType::const_iterator const_iterator

Definition at line 128 of file ConstCirculator.H.

◆ const_reference

typedef ContainerType::const_reference const_reference

Definition at line 132 of file ConstCirculator.H.

Constructor & Destructor Documentation

◆ ConstCirculator() [1/4]

Definition at line 27 of file ConstCirculatorI.H.

◆ ConstCirculator() [2/4]

ConstCirculator ( const ContainerType &  container)
inlineexplicit

Definition at line 39 of file ConstCirculatorI.H.

◆ ConstCirculator() [3/4]

ConstCirculator ( const const_iterator begin,
const const_iterator end 
)
inline

Definition at line 53 of file ConstCirculatorI.H.

◆ ConstCirculator() [4/4]

ConstCirculator ( const ConstCirculator< ContainerType > &  rhs)
inline

Definition at line 68 of file ConstCirculatorI.H.

◆ ~ConstCirculator()

Definition at line 83 of file ConstCirculatorI.H.

Member Function Documentation

◆ size()

Foam::ConstCirculator< ContainerType >::size_type size
inline

Definition at line 91 of file ConstCirculatorI.H.

◆ circulate()

bool circulate ( const CirculatorBase::direction  dir = NONE)
inline

Definition at line 99 of file ConstCirculatorI.H.

References CirculatorBase::ANTICLOCKWISE, and CirculatorBase::CLOCKWISE.

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

Here is the caller graph for this function:

◆ setFulcrumToIterator()

void setFulcrumToIterator
inline

Definition at line 117 of file ConstCirculatorI.H.

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

Here is the caller graph for this function:

◆ setIteratorToFulcrum()

void setIteratorToFulcrum
inline

Definition at line 124 of file ConstCirculatorI.H.

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

Here is the caller graph for this function:

◆ nRotations()

Foam::ConstCirculator< ContainerType >::difference_type nRotations
inline

Definition at line 132 of file ConstCirculatorI.H.

Referenced by processorPolyPatch::matchFace().

Here is the caller graph for this function:

◆ next()

Foam::ConstCirculator< ContainerType >::const_reference next
inline

Definition at line 140 of file ConstCirculatorI.H.

◆ prev()

Foam::ConstCirculator< ContainerType >::const_reference prev
inline

Definition at line 153 of file ConstCirculatorI.H.

◆ operator=()

void operator= ( const ConstCirculator< ContainerType > &  rhs)
inline

◆ operator++() [1/2]

Foam::ConstCirculator< ContainerType > & operator++
inline

Definition at line 186 of file ConstCirculatorI.H.

◆ operator++() [2/2]

Foam::ConstCirculator< ContainerType > operator++ ( int  )
inline

Definition at line 200 of file ConstCirculatorI.H.

◆ operator--() [1/2]

Foam::ConstCirculator< ContainerType > & operator--
inline

Definition at line 210 of file ConstCirculatorI.H.

◆ operator--() [2/2]

Foam::ConstCirculator< ContainerType > operator-- ( int  )
inline

Definition at line 224 of file ConstCirculatorI.H.

◆ operator==()

bool operator== ( const ConstCirculator< ContainerType > &  c) const
inline

Definition at line 234 of file ConstCirculatorI.H.

References Foam::constant::universal::c.

◆ operator!=()

bool operator!= ( const ConstCirculator< ContainerType > &  c) const
inline

Definition at line 250 of file ConstCirculatorI.H.

References Foam::constant::universal::c.

◆ operator*()

Foam::ConstCirculator< ContainerType >::const_reference operator*
inline

Definition at line 260 of file ConstCirculatorI.H.

◆ operator()()

Foam::ConstCirculator< ContainerType >::const_reference operator()
inline

Definition at line 268 of file ConstCirculatorI.H.

References Foam::operator*().

Here is the call graph for this function:

◆ operator-()

Foam::ConstCirculator< ContainerType >::difference_type operator- ( const ConstCirculator< ContainerType > &  c) const
inline

Definition at line 277 of file ConstCirculatorI.H.

References Foam::constant::universal::c.

Member Data Documentation

◆ begin_

ContainerType::const_iterator begin_
protected

Definition at line 99 of file ConstCirculator.H.

Referenced by ConstCirculator< ContainerType >::operator=().

◆ end_

ContainerType::const_iterator end_
protected

Definition at line 102 of file ConstCirculator.H.

Referenced by ConstCirculator< ContainerType >::operator=().

◆ iter_

ContainerType::const_iterator iter_
protected

Definition at line 105 of file ConstCirculator.H.

Referenced by ConstCirculator< ContainerType >::operator=().

◆ fulcrum_

ContainerType::const_iterator fulcrum_
protected

Definition at line 110 of file ConstCirculator.H.

Referenced by ConstCirculator< ContainerType >::operator=().


The documentation for this class was generated from the following files:
Foam::endl
Ostream & endl(Ostream &os)
Definition: Ostream.H:381
Foam::Info
messageStream Info
Foam::CirculatorBase::CLOCKWISE
@ CLOCKWISE
Definition: CirculatorBase.H:50
f
labelList f(nPoints)
Foam::identity
labelList identity(const label len, label start=0)
Definition: labelList.C:31
Foam::CirculatorBase::ANTICLOCKWISE
@ ANTICLOCKWISE
Definition: CirculatorBase.H:51