Rename circulators to be consistent with the standard OpenFOAM class naming convention

This commit is contained in:
Henry Weller
2015-08-06 16:54:47 +01:00
parent 65e8e2273b
commit 913103ec0a
8 changed files with 153 additions and 153 deletions

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -31,8 +31,8 @@ Description
#include "List.H" #include "List.H"
#include "ListOps.H" #include "ListOps.H"
#include "face.H" #include "face.H"
#include "circulator.H" #include "Circulator.H"
#include "const_circulator.H" #include "ConstCirculator.H"
using namespace Foam; using namespace Foam;
@ -50,7 +50,7 @@ int main(int argc, char *argv[])
face f(identity(4)); face f(identity(4));
const_circulator<face> cStart(f); ConstCirculator<face> cStart(f);
if (cStart.size()) do if (cStart.size()) do
{ {
@ -69,7 +69,7 @@ int main(int argc, char *argv[])
Info<< nl << nl << "Test non-const circulator" << nl << endl; Info<< nl << nl << "Test non-const circulator" << nl << endl;
circulator<face> cStart2(f); Circulator<face> cStart2(f);
Info<< "Face before : " << f << endl; Info<< "Face before : " << f << endl;
@ -138,7 +138,7 @@ int main(int argc, char *argv[])
Info<< nl << nl << "Zero face" << nl << endl; Info<< nl << nl << "Zero face" << nl << endl;
face fZero; face fZero;
circulator<face> cZero(fZero); Circulator<face> cZero(fZero);
if (cZero.size()) do if (cZero.size()) do
{ {
@ -149,7 +149,7 @@ int main(int argc, char *argv[])
fZero = face(identity(5)); fZero = face(identity(5));
// circulator was invalidated so reset // circulator was invalidated so reset
cZero = circulator<face>(fZero); cZero = Circulator<face>(fZero);
do do
{ {
@ -161,8 +161,8 @@ int main(int argc, char *argv[])
Info<< nl << nl << "Simultaneously go forwards/backwards over face " << f Info<< nl << nl << "Simultaneously go forwards/backwards over face " << f
<< nl << endl; << nl << endl;
const_circulator<face> circForward(f); ConstCirculator<face> circForward(f);
const_circulator<face> circBackward(f); ConstCirculator<face> circBackward(f);
if (circForward.size() && circBackward.size()) do if (circForward.size() && circBackward.size()) do
{ {

View File

@ -27,7 +27,7 @@ License
#include "vectorTools.H" #include "vectorTools.H"
#include "triangle.H" #include "triangle.H"
#include "tetrahedron.H" #include "tetrahedron.H"
#include "const_circulator.H" #include "ConstCirculator.H"
#include "DelaunayMeshTools.H" #include "DelaunayMeshTools.H"
#include "OBJstream.H" #include "OBJstream.H"
@ -183,8 +183,8 @@ void Foam::conformalVoronoiMesh::createEdgePointGroupByCirculating
const List<sideVolumeType>& normalVolumeTypes = feMesh.normalVolumeTypes(); const List<sideVolumeType>& normalVolumeTypes = feMesh.normalVolumeTypes();
const_circulator<labelList> circ(edNormalIs); ConstCirculator<labelList> circ(edNormalIs);
const_circulator<labelList> circNormalDirs(feNormalDirections); ConstCirculator<labelList> circNormalDirs(feNormalDirections);
Map<Foam::point> masterPoints; Map<Foam::point> masterPoints;
Map<vertexType> masterPointsTypes; Map<vertexType> masterPointsTypes;

View File

@ -29,7 +29,7 @@ License
#include "conformalVoronoiMesh.H" #include "conformalVoronoiMesh.H"
#include "cellShapeControl.H" #include "cellShapeControl.H"
#include "DelaunayMeshTools.H" #include "DelaunayMeshTools.H"
#include "const_circulator.H" #include "ConstCirculator.H"
#include "backgroundMeshDecomposition.H" #include "backgroundMeshDecomposition.H"
#include "autoPtr.H" #include "autoPtr.H"
#include "mapDistribute.H" #include "mapDistribute.H"
@ -233,7 +233,7 @@ void Foam::featurePointConformer::createMasterAndSlavePoints
// Info<< nl << featPt << " " << pointEdgeTypes; // Info<< nl << featPt << " " << pointEdgeTypes;
const_circulator<labelList> circ(featPtEdges); ConstCirculator<labelList> circ(featPtEdges);
// Loop around the edges of the feature point // Loop around the edges of the feature point
if (circ.size()) do if (circ.size()) do

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::circulator Foam::Circulator
Description Description
Walks over a container as if it were circular. The container must have the Walks over a container as if it were circular. The container must have the
@ -38,10 +38,10 @@ Description
\code \code
face f(identity(5)); face f(identity(5));
// Construct circulator from the face // Construct Circulator from the face
circulator<face> circ(f); Circulator<face> circ(f);
// First check that the circulator has a size to iterate over. // First check that the Circulator has a size to iterate over.
// Then circulate around the list starting and finishing at the fulcrum. // Then circulate around the list starting and finishing at the fulcrum.
if (circ.size()) do if (circ.size()) do
{ {
@ -53,12 +53,12 @@ Description
\endcode \endcode
SourceFiles SourceFiles
circulatorI.H CirculatorI.H
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef circulator_H #ifndef Circulator_H
#define circulator_H #define Circulator_H
#include "CirculatorBase.H" #include "CirculatorBase.H"
@ -69,11 +69,11 @@ namespace Foam
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class circulator Declaration Class Circulator Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ContainerType> template<class ContainerType>
class circulator class Circulator
: :
public CirculatorBase public CirculatorBase
{ {
@ -122,20 +122,20 @@ public:
// Constructors // Constructors
//- Construct null //- Construct null
inline circulator(); inline Circulator();
//- Construct from a container. //- Construct from a container.
inline explicit circulator(ContainerType& container); inline explicit Circulator(ContainerType& container);
//- Construct from two iterators //- Construct from two iterators
inline circulator(const iterator& begin, const iterator& end); inline Circulator(const iterator& begin, const iterator& end);
//- Construct as copy //- Construct as copy
inline circulator(const circulator<ContainerType>&); inline Circulator(const Circulator<ContainerType>&);
//- Destructor //- Destructor
~circulator(); ~Circulator();
// Member Functions // Member Functions
@ -153,7 +153,7 @@ public:
inline void setIteratorToFulcrum(); inline void setIteratorToFulcrum();
//- Return the distance between the iterator and the fulcrum. This is //- Return the distance between the iterator and the fulcrum. This is
// equivalent to the number of rotations of the circulator. // equivalent to the number of rotations of the Circulator.
inline difference_type nRotations() const; inline difference_type nRotations() const;
//- Dereference the next iterator and return //- Dereference the next iterator and return
@ -165,37 +165,37 @@ public:
// Member Operators // Member Operators
//- Assignment operator for circulators that operate on the same //- Assignment operator for Circulators that operate on the same
// container type // container type
inline void operator=(const circulator<ContainerType>&); inline void operator=(const Circulator<ContainerType>&);
//- Prefix increment. Increments the iterator. //- Prefix increment. Increments the iterator.
// Sets the iterator to the beginning of the container if it reaches // Sets the iterator to the beginning of the container if it reaches
// the end // the end
inline circulator<ContainerType>& operator++(); inline Circulator<ContainerType>& operator++();
//- Postfix increment. Increments the iterator. //- Postfix increment. Increments the iterator.
// Sets the iterator to the beginning of the container if it reaches // Sets the iterator to the beginning of the container if it reaches
// the end // the end
inline circulator<ContainerType> operator++(int); inline Circulator<ContainerType> operator++(int);
//- Prefix decrement. Decrements the iterator. //- Prefix decrement. Decrements the iterator.
// Sets the iterator to the end of the container if it reaches // Sets the iterator to the end of the container if it reaches
// the beginning // the beginning
inline circulator<ContainerType>& operator--(); inline Circulator<ContainerType>& operator--();
//- Postfix decrement. Decrements the iterator. //- Postfix decrement. Decrements the iterator.
// Sets the iterator to the end of the container if it reaches // Sets the iterator to the end of the container if it reaches
// the beginning // the beginning
inline circulator<ContainerType> operator--(int); inline Circulator<ContainerType> operator--(int);
//- Check for equality of this iterator with another iterator that //- Check for equality of this iterator with another iterator that
// operate on the same container type // operate on the same container type
inline bool operator==(const circulator<ContainerType>& c) const; inline bool operator==(const Circulator<ContainerType>& c) const;
//- Check for inequality of this iterator with another iterator that //- Check for inequality of this iterator with another iterator that
// operate on the same container type // operate on the same container type
inline bool operator!=(const circulator<ContainerType>& c) const; inline bool operator!=(const Circulator<ContainerType>& c) const;
//- Dereference the iterator and return //- Dereference the iterator and return
inline reference operator*() const; inline reference operator*() const;
@ -207,7 +207,7 @@ public:
// that operate on the same container type // that operate on the same container type
inline difference_type operator- inline difference_type operator-
( (
const circulator<ContainerType>& c const Circulator<ContainerType>& c
) const; ) const;
}; };
@ -218,7 +218,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "circulatorI.H" #include "CirculatorI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -26,7 +26,7 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ContainerType> template<class ContainerType>
Foam::circulator<ContainerType>::circulator() Foam::Circulator<ContainerType>::Circulator()
: :
CirculatorBase(), CirculatorBase(),
begin_(0), begin_(0),
@ -37,7 +37,7 @@ Foam::circulator<ContainerType>::circulator()
template<class ContainerType> template<class ContainerType>
Foam::circulator<ContainerType>::circulator(ContainerType& container) Foam::Circulator<ContainerType>::Circulator(ContainerType& container)
: :
CirculatorBase(), CirculatorBase(),
begin_(container.begin()), begin_(container.begin()),
@ -48,7 +48,7 @@ Foam::circulator<ContainerType>::circulator(ContainerType& container)
template<class ContainerType> template<class ContainerType>
Foam::circulator<ContainerType>::circulator Foam::Circulator<ContainerType>::Circulator
( (
const iterator& begin, const iterator& begin,
const iterator& end const iterator& end
@ -63,9 +63,9 @@ Foam::circulator<ContainerType>::circulator
template<class ContainerType> template<class ContainerType>
Foam::circulator<ContainerType>::circulator Foam::Circulator<ContainerType>::Circulator
( (
const circulator<ContainerType>& rhs const Circulator<ContainerType>& rhs
) )
: :
CirculatorBase(), CirculatorBase(),
@ -79,22 +79,22 @@ Foam::circulator<ContainerType>::circulator
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ContainerType> template<class ContainerType>
Foam::circulator<ContainerType>::~circulator() Foam::Circulator<ContainerType>::~Circulator()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ContainerType> template<class ContainerType>
typename Foam::circulator<ContainerType>::size_type typename Foam::Circulator<ContainerType>::size_type
Foam::circulator<ContainerType>::size() const Foam::Circulator<ContainerType>::size() const
{ {
return end_ - begin_; return end_ - begin_;
} }
template<class ContainerType> template<class ContainerType>
bool Foam::circulator<ContainerType>::circulate bool Foam::Circulator<ContainerType>::circulate
( (
const CirculatorBase::direction dir const CirculatorBase::direction dir
) )
@ -113,30 +113,30 @@ bool Foam::circulator<ContainerType>::circulate
template<class ContainerType> template<class ContainerType>
void Foam::circulator<ContainerType>::setFulcrumToIterator() void Foam::Circulator<ContainerType>::setFulcrumToIterator()
{ {
fulcrum_ = iter_; fulcrum_ = iter_;
} }
template<class ContainerType> template<class ContainerType>
void Foam::circulator<ContainerType>::setIteratorToFulcrum() void Foam::Circulator<ContainerType>::setIteratorToFulcrum()
{ {
iter_ = fulcrum_; iter_ = fulcrum_;
} }
template<class ContainerType> template<class ContainerType>
typename Foam::circulator<ContainerType>::difference_type typename Foam::Circulator<ContainerType>::difference_type
Foam::circulator<ContainerType>::nRotations() const Foam::Circulator<ContainerType>::nRotations() const
{ {
return (iter_ - fulcrum_); return (iter_ - fulcrum_);
} }
template<class ContainerType> template<class ContainerType>
typename Foam::circulator<ContainerType>::reference typename Foam::Circulator<ContainerType>::reference
Foam::circulator<ContainerType>::next() const Foam::Circulator<ContainerType>::next() const
{ {
if (iter_ == end_ - 1) if (iter_ == end_ - 1)
{ {
@ -148,8 +148,8 @@ Foam::circulator<ContainerType>::next() const
template<class ContainerType> template<class ContainerType>
typename Foam::circulator<ContainerType>::reference typename Foam::Circulator<ContainerType>::reference
Foam::circulator<ContainerType>::prev() const Foam::Circulator<ContainerType>::prev() const
{ {
if (iter_ == begin_) if (iter_ == begin_)
{ {
@ -163,9 +163,9 @@ Foam::circulator<ContainerType>::prev() const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class ContainerType> template<class ContainerType>
void Foam::circulator<ContainerType>::operator= void Foam::Circulator<ContainerType>::operator=
( (
const circulator<ContainerType>& rhs const Circulator<ContainerType>& rhs
) )
{ {
// Check for assignment to self // Check for assignment to self
@ -173,8 +173,8 @@ void Foam::circulator<ContainerType>::operator=
{ {
FatalErrorIn FatalErrorIn
( (
"Foam::circulator<ContainerType>::operator=" "Foam::Circulator<ContainerType>::operator="
"(const Foam::circulator<ContainerType>&)" "(const Foam::Circulator<ContainerType>&)"
) << "Attempted assignment to self" ) << "Attempted assignment to self"
<< abort(FatalError); << abort(FatalError);
} }
@ -187,8 +187,8 @@ void Foam::circulator<ContainerType>::operator=
template<class ContainerType> template<class ContainerType>
Foam::circulator<ContainerType>& Foam::Circulator<ContainerType>&
Foam::circulator<ContainerType>::operator++() Foam::Circulator<ContainerType>::operator++()
{ {
++iter_; ++iter_;
if (iter_ == end_) if (iter_ == end_)
@ -201,18 +201,18 @@ Foam::circulator<ContainerType>::operator++()
template<class ContainerType> template<class ContainerType>
Foam::circulator<ContainerType> Foam::Circulator<ContainerType>
Foam::circulator<ContainerType>::operator++(int) Foam::Circulator<ContainerType>::operator++(int)
{ {
circulator<ContainerType> tmp = *this; Circulator<ContainerType> tmp = *this;
++(*this); ++(*this);
return tmp; return tmp;
} }
template<class ContainerType> template<class ContainerType>
Foam::circulator<ContainerType>& Foam::Circulator<ContainerType>&
Foam::circulator<ContainerType>::operator--() Foam::Circulator<ContainerType>::operator--()
{ {
if (iter_ == begin_) if (iter_ == begin_)
{ {
@ -225,19 +225,19 @@ Foam::circulator<ContainerType>::operator--()
template<class ContainerType> template<class ContainerType>
Foam::circulator<ContainerType> Foam::Circulator<ContainerType>
Foam::circulator<ContainerType>::operator--(int) Foam::Circulator<ContainerType>::operator--(int)
{ {
circulator<ContainerType> tmp = *this; Circulator<ContainerType> tmp = *this;
--(*this); --(*this);
return tmp; return tmp;
} }
template<class ContainerType> template<class ContainerType>
bool Foam::circulator<ContainerType>::operator== bool Foam::Circulator<ContainerType>::operator==
( (
const circulator<ContainerType>& c const Circulator<ContainerType>& c
) const ) const
{ {
return return
@ -251,9 +251,9 @@ bool Foam::circulator<ContainerType>::operator==
template<class ContainerType> template<class ContainerType>
bool Foam::circulator<ContainerType>::operator!= bool Foam::Circulator<ContainerType>::operator!=
( (
const circulator<ContainerType>& c const Circulator<ContainerType>& c
) const ) const
{ {
return !(*this == c); return !(*this == c);
@ -261,26 +261,26 @@ bool Foam::circulator<ContainerType>::operator!=
template<class ContainerType> template<class ContainerType>
typename Foam::circulator<ContainerType>::reference typename Foam::Circulator<ContainerType>::reference
Foam::circulator<ContainerType>::operator*() const Foam::Circulator<ContainerType>::operator*() const
{ {
return *iter_; return *iter_;
} }
template<class ContainerType> template<class ContainerType>
typename Foam::circulator<ContainerType>::reference typename Foam::Circulator<ContainerType>::reference
Foam::circulator<ContainerType>::operator()() const Foam::Circulator<ContainerType>::operator()() const
{ {
return operator*(); return operator*();
} }
template<class ContainerType> template<class ContainerType>
typename Foam::circulator<ContainerType>::difference_type typename Foam::Circulator<ContainerType>::difference_type
Foam::circulator<ContainerType>::operator- Foam::Circulator<ContainerType>::operator-
( (
const circulator<ContainerType>& c const Circulator<ContainerType>& c
) const ) const
{ {
return iter_ - c.iter_; return iter_ - c.iter_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class Class
Foam::const_circulator Foam::ConstCirculator
Description Description
Walks over a container as if it were circular. The container must have the Walks over a container as if it were circular. The container must have the
@ -39,7 +39,7 @@ Description
face f(identity(5)); face f(identity(5));
// Construct circulator from the face // Construct circulator from the face
const_circulator<face> circ(f); ConstCirculator<face> circ(f);
// First check that the circulator has a size to iterate over. // First check that the circulator has a size to iterate over.
// Then circulate around the list starting and finishing at the fulcrum. // Then circulate around the list starting and finishing at the fulcrum.
@ -53,8 +53,8 @@ Description
\code \code
face f(identity(5)); face f(identity(5));
const_circulator<face> circClockwise(f); ConstCirculator<face> circClockwise(f);
const_circulator<face> circAnticlockwise(f); ConstCirculator<face> circAnticlockwise(f);
if (circClockwise.size() && circAnticlockwise.size()) do if (circClockwise.size() && circAnticlockwise.size()) do
{ {
@ -69,12 +69,12 @@ Description
\endcode \endcode
SourceFiles SourceFiles
const_circulatorI.H ConstCirculatorI.H
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#ifndef const_circulator_H #ifndef ConstCirculator_H
#define const_circulator_H #define ConstCirculator_H
#include "CirculatorBase.H" #include "CirculatorBase.H"
@ -85,11 +85,11 @@ namespace Foam
/*---------------------------------------------------------------------------*\ /*---------------------------------------------------------------------------*\
Class const_circulator Declaration Class ConstCirculator Declaration
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
template<class ContainerType> template<class ContainerType>
class const_circulator class ConstCirculator
: :
public CirculatorBase public CirculatorBase
{ {
@ -138,24 +138,24 @@ public:
// Constructors // Constructors
//- Construct null //- Construct null
inline const_circulator(); inline ConstCirculator();
//- Construct from a container. //- Construct from a container.
inline explicit const_circulator(const ContainerType& container); inline explicit ConstCirculator(const ContainerType& container);
//- Construct from two iterators //- Construct from two iterators
inline const_circulator inline ConstCirculator
( (
const const_iterator& begin, const const_iterator& begin,
const const_iterator& end const const_iterator& end
); );
//- Construct as copy //- Construct as copy
inline const_circulator(const const_circulator<ContainerType>&); inline ConstCirculator(const ConstCirculator<ContainerType>&);
//- Destructor //- Destructor
~const_circulator(); ~ConstCirculator();
// Member Functions // Member Functions
@ -187,35 +187,35 @@ public:
//- Assignment operator for circulators that operate on the same //- Assignment operator for circulators that operate on the same
// container type // container type
inline void operator=(const const_circulator<ContainerType>&); inline void operator=(const ConstCirculator<ContainerType>&);
//- Prefix increment. Increments the iterator. //- Prefix increment. Increments the iterator.
// Sets the iterator to the beginning of the container if it reaches // Sets the iterator to the beginning of the container if it reaches
// the end // the end
inline const_circulator<ContainerType>& operator++(); inline ConstCirculator<ContainerType>& operator++();
//- Postfix increment. Increments the iterator. //- Postfix increment. Increments the iterator.
// Sets the iterator to the beginning of the container if it reaches // Sets the iterator to the beginning of the container if it reaches
// the end // the end
inline const_circulator<ContainerType> operator++(int); inline ConstCirculator<ContainerType> operator++(int);
//- Prefix decrement. Decrements the iterator. //- Prefix decrement. Decrements the iterator.
// Sets the iterator to the end of the container if it reaches // Sets the iterator to the end of the container if it reaches
// the beginning // the beginning
inline const_circulator<ContainerType>& operator--(); inline ConstCirculator<ContainerType>& operator--();
//- Postfix decrement. Decrements the iterator. //- Postfix decrement. Decrements the iterator.
// Sets the iterator to the end of the container if it reaches // Sets the iterator to the end of the container if it reaches
// the beginning // the beginning
inline const_circulator<ContainerType> operator--(int); inline ConstCirculator<ContainerType> operator--(int);
//- Check for equality of this iterator with another iterator that //- Check for equality of this iterator with another iterator that
// operate on the same container type // operate on the same container type
inline bool operator==(const const_circulator<ContainerType>& c) const; inline bool operator==(const ConstCirculator<ContainerType>& c) const;
//- Check for inequality of this iterator with another iterator that //- Check for inequality of this iterator with another iterator that
// operate on the same container type // operate on the same container type
inline bool operator!=(const const_circulator<ContainerType>& c) const; inline bool operator!=(const ConstCirculator<ContainerType>& c) const;
//- Dereference the iterator and return //- Dereference the iterator and return
inline const_reference operator*() const; inline const_reference operator*() const;
@ -227,7 +227,7 @@ public:
// that operate on the same container type // that operate on the same container type
inline difference_type operator- inline difference_type operator-
( (
const const_circulator<ContainerType>& c const ConstCirculator<ContainerType>& c
) const; ) const;
}; };
@ -238,7 +238,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "const_circulatorI.H" #include "ConstCirculatorI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -26,7 +26,7 @@ License
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template<class ContainerType> template<class ContainerType>
Foam::const_circulator<ContainerType>::const_circulator() Foam::ConstCirculator<ContainerType>::ConstCirculator()
: :
CirculatorBase(), CirculatorBase(),
begin_(0), begin_(0),
@ -37,7 +37,7 @@ Foam::const_circulator<ContainerType>::const_circulator()
template<class ContainerType> template<class ContainerType>
Foam::const_circulator<ContainerType>::const_circulator Foam::ConstCirculator<ContainerType>::ConstCirculator
( (
const ContainerType& container const ContainerType& container
) )
@ -51,7 +51,7 @@ Foam::const_circulator<ContainerType>::const_circulator
template<class ContainerType> template<class ContainerType>
Foam::const_circulator<ContainerType>::const_circulator Foam::ConstCirculator<ContainerType>::ConstCirculator
( (
const const_iterator& begin, const const_iterator& begin,
const const_iterator& end const const_iterator& end
@ -66,9 +66,9 @@ Foam::const_circulator<ContainerType>::const_circulator
template<class ContainerType> template<class ContainerType>
Foam::const_circulator<ContainerType>::const_circulator Foam::ConstCirculator<ContainerType>::ConstCirculator
( (
const const_circulator<ContainerType>& rhs const ConstCirculator<ContainerType>& rhs
) )
: :
CirculatorBase(), CirculatorBase(),
@ -82,22 +82,22 @@ Foam::const_circulator<ContainerType>::const_circulator
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
template<class ContainerType> template<class ContainerType>
Foam::const_circulator<ContainerType>::~const_circulator() Foam::ConstCirculator<ContainerType>::~ConstCirculator()
{} {}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class ContainerType> template<class ContainerType>
typename Foam::const_circulator<ContainerType>::size_type typename Foam::ConstCirculator<ContainerType>::size_type
Foam::const_circulator<ContainerType>::size() const Foam::ConstCirculator<ContainerType>::size() const
{ {
return end_ - begin_; return end_ - begin_;
} }
template<class ContainerType> template<class ContainerType>
bool Foam::const_circulator<ContainerType>::circulate bool Foam::ConstCirculator<ContainerType>::circulate
( (
const CirculatorBase::direction dir const CirculatorBase::direction dir
) )
@ -116,30 +116,30 @@ bool Foam::const_circulator<ContainerType>::circulate
template<class ContainerType> template<class ContainerType>
void Foam::const_circulator<ContainerType>::setFulcrumToIterator() void Foam::ConstCirculator<ContainerType>::setFulcrumToIterator()
{ {
fulcrum_ = iter_; fulcrum_ = iter_;
} }
template<class ContainerType> template<class ContainerType>
void Foam::const_circulator<ContainerType>::setIteratorToFulcrum() void Foam::ConstCirculator<ContainerType>::setIteratorToFulcrum()
{ {
iter_ = fulcrum_; iter_ = fulcrum_;
} }
template<class ContainerType> template<class ContainerType>
typename Foam::const_circulator<ContainerType>::difference_type typename Foam::ConstCirculator<ContainerType>::difference_type
Foam::const_circulator<ContainerType>::nRotations() const Foam::ConstCirculator<ContainerType>::nRotations() const
{ {
return (iter_ - fulcrum_); return (iter_ - fulcrum_);
} }
template<class ContainerType> template<class ContainerType>
typename Foam::const_circulator<ContainerType>::const_reference typename Foam::ConstCirculator<ContainerType>::const_reference
Foam::const_circulator<ContainerType>::next() const Foam::ConstCirculator<ContainerType>::next() const
{ {
if (iter_ == end_ - 1) if (iter_ == end_ - 1)
{ {
@ -151,8 +151,8 @@ Foam::const_circulator<ContainerType>::next() const
template<class ContainerType> template<class ContainerType>
typename Foam::const_circulator<ContainerType>::const_reference typename Foam::ConstCirculator<ContainerType>::const_reference
Foam::const_circulator<ContainerType>::prev() const Foam::ConstCirculator<ContainerType>::prev() const
{ {
if (iter_ == begin_) if (iter_ == begin_)
{ {
@ -166,9 +166,9 @@ Foam::const_circulator<ContainerType>::prev() const
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template<class ContainerType> template<class ContainerType>
void Foam::const_circulator<ContainerType>::operator= void Foam::ConstCirculator<ContainerType>::operator=
( (
const const_circulator<ContainerType>& rhs const ConstCirculator<ContainerType>& rhs
) )
{ {
// Check for assignment to self // Check for assignment to self
@ -176,8 +176,8 @@ void Foam::const_circulator<ContainerType>::operator=
{ {
FatalErrorIn FatalErrorIn
( (
"Foam::const_circulator<ContainerType>::operator=" "Foam::ConstCirculator<ContainerType>::operator="
"(const Foam::const_circulator<ContainerType>&)" "(const Foam::ConstCirculator<ContainerType>&)"
) << "Attempted assignment to self" ) << "Attempted assignment to self"
<< abort(FatalError); << abort(FatalError);
} }
@ -190,8 +190,8 @@ void Foam::const_circulator<ContainerType>::operator=
template<class ContainerType> template<class ContainerType>
Foam::const_circulator<ContainerType>& Foam::ConstCirculator<ContainerType>&
Foam::const_circulator<ContainerType>::operator++() Foam::ConstCirculator<ContainerType>::operator++()
{ {
++iter_; ++iter_;
if (iter_ == end_) if (iter_ == end_)
@ -204,18 +204,18 @@ Foam::const_circulator<ContainerType>::operator++()
template<class ContainerType> template<class ContainerType>
Foam::const_circulator<ContainerType> Foam::ConstCirculator<ContainerType>
Foam::const_circulator<ContainerType>::operator++(int) Foam::ConstCirculator<ContainerType>::operator++(int)
{ {
const_circulator<ContainerType> tmp = *this; ConstCirculator<ContainerType> tmp = *this;
++(*this); ++(*this);
return tmp; return tmp;
} }
template<class ContainerType> template<class ContainerType>
Foam::const_circulator<ContainerType>& Foam::ConstCirculator<ContainerType>&
Foam::const_circulator<ContainerType>::operator--() Foam::ConstCirculator<ContainerType>::operator--()
{ {
if (iter_ == begin_) if (iter_ == begin_)
{ {
@ -228,19 +228,19 @@ Foam::const_circulator<ContainerType>::operator--()
template<class ContainerType> template<class ContainerType>
Foam::const_circulator<ContainerType> Foam::ConstCirculator<ContainerType>
Foam::const_circulator<ContainerType>::operator--(int) Foam::ConstCirculator<ContainerType>::operator--(int)
{ {
const_circulator<ContainerType> tmp = *this; ConstCirculator<ContainerType> tmp = *this;
--(*this); --(*this);
return tmp; return tmp;
} }
template<class ContainerType> template<class ContainerType>
bool Foam::const_circulator<ContainerType>::operator== bool Foam::ConstCirculator<ContainerType>::operator==
( (
const const_circulator<ContainerType>& c const ConstCirculator<ContainerType>& c
) const ) const
{ {
return return
@ -254,9 +254,9 @@ bool Foam::const_circulator<ContainerType>::operator==
template<class ContainerType> template<class ContainerType>
bool Foam::const_circulator<ContainerType>::operator!= bool Foam::ConstCirculator<ContainerType>::operator!=
( (
const const_circulator<ContainerType>& c const ConstCirculator<ContainerType>& c
) const ) const
{ {
return !(*this == c); return !(*this == c);
@ -264,26 +264,26 @@ bool Foam::const_circulator<ContainerType>::operator!=
template<class ContainerType> template<class ContainerType>
typename Foam::const_circulator<ContainerType>::const_reference typename Foam::ConstCirculator<ContainerType>::const_reference
Foam::const_circulator<ContainerType>::operator*() const Foam::ConstCirculator<ContainerType>::operator*() const
{ {
return *iter_; return *iter_;
} }
template<class ContainerType> template<class ContainerType>
typename Foam::const_circulator<ContainerType>::const_reference typename Foam::ConstCirculator<ContainerType>::const_reference
Foam::const_circulator<ContainerType>::operator()() const Foam::ConstCirculator<ContainerType>::operator()() const
{ {
return operator*(); return operator*();
} }
template<class ContainerType> template<class ContainerType>
typename Foam::const_circulator<ContainerType>::difference_type typename Foam::ConstCirculator<ContainerType>::difference_type
Foam::const_circulator<ContainerType>::operator- Foam::ConstCirculator<ContainerType>::operator-
( (
const const_circulator<ContainerType>& c const ConstCirculator<ContainerType>& c
) const ) const
{ {
return iter_ - c.iter_; return iter_ - c.iter_;

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -34,7 +34,7 @@ License
#include "Time.H" #include "Time.H"
#include "transformList.H" #include "transformList.H"
#include "PstreamBuffers.H" #include "PstreamBuffers.H"
#include "const_circulator.H" #include "ConstCirculator.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -601,8 +601,8 @@ Foam::label Foam::processorPolyPatch::matchFace
scalar closestMatchDistSqr = sqr(GREAT); scalar closestMatchDistSqr = sqr(GREAT);
const_circulator<face> aCirc(a); ConstCirculator<face> aCirc(a);
const_circulator<face> bCirc(b); ConstCirculator<face> bCirc(b);
do do
{ {
@ -611,7 +611,7 @@ Foam::label Foam::processorPolyPatch::matchFace
if (diffSqr < absTolSqr) if (diffSqr < absTolSqr)
{ {
// Found a matching point. Set the fulcrum of b to the iterator // Found a matching point. Set the fulcrum of b to the iterator
const_circulator<face> bCirc2 = bCirc; ConstCirculator<face> bCirc2 = bCirc;
++aCirc; ++aCirc;
bCirc2.setFulcrumToIterator(); bCirc2.setFulcrumToIterator();