Walks over a container as if it were circular. The container must have the following members defined:
More...
|
| | Circulator ()=default |
| | Default construct. More...
|
| |
| | Circulator (Container &obj) |
| | Construct from begin/end of a container. More...
|
| |
| | Circulator (const typename Container::iterator &begin, const typename Container::iterator &end) |
| | Construct from two iterators. More...
|
| |
| | Circulator (const Circulator< Container > &rhs)=default |
| | Copy construct. More...
|
| |
| Circulator< Container > & | operator= (const Circulator< Container > &rhs)=default |
| | Copy assignment. More...
|
| |
| | CirculatorIters () |
| | Default construct. More...
|
| |
| | CirculatorIters (const iterator &begin, const iterator &end) |
| | Construct from begin/end iterators. More...
|
| |
| | CirculatorIters (const CirculatorIters< Container, Const > &rhs) |
| | Copy construct. More...
|
| |
| bool | empty () const |
| | True if begin/end iterators are identical. More...
|
| |
| size_type | size () const |
| | Return the range of the iterator pair. More...
|
| |
| difference_type | nRotations () const |
| | The distance between the iterator and the fulcrum. More...
|
| |
| bool | circulate (const CirculatorBase::direction dir=CirculatorBase::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...
|
| |
| reference | curr () const |
| | Dereference the current iterator. More...
|
| |
| reference | next () const |
| | Dereference the next iterator. More...
|
| |
| reference | prev () const |
| | Dereference the previous iterator. More...
|
| |
| void | operator= (const CirculatorIters< Container, Const > &rhs) |
| | Assignment operator for circulators operating on the same container type. More...
|
| |
| CirculatorIters< Container, Const > & | operator++ () |
| | Prefix increment the iterator. More...
|
| |
| CirculatorIters< Container, Const > | operator++ (int) |
| | Postfix increment the iterator. More...
|
| |
| CirculatorIters< Container, Const > & | operator-- () |
| | Prefix decrement the iterator. More...
|
| |
| CirculatorIters< Container, Const > | operator-- (int) |
| | Postfix decrement the iterator. More...
|
| |
| bool | operator== (const CirculatorIters< Container, Const > &) const |
| | Check for equality of this iterator with another iterator that operate on the same container type. More...
|
| |
| bool | operator!= (const CirculatorIters< Container, Const > &) const |
| | Check for inequality of this iterator with another iterator that operate on the same container type. More...
|
| |
| reference | operator* () const |
| | Dereference the iterator. Same as curr() More...
|
| |
| reference | operator() () const |
| | Dereference the iterator. Same as curr() More...
|
| |
| difference_type | operator- (const CirculatorIters< Container, Const > &) const |
| | Return the difference between this iterator and another iterator that operate on the same container type. More...
|
| |
| | CirculatorBase ()=default |
| | Default construct. More...
|
| |
|
| using | size_type = typename Container::size_type |
| | The type that can represent the size of Container. More...
|
| |
| using | difference_type = typename Container::difference_type |
| | The type that represents difference between iterator objects. More...
|
| |
| using | iterator = typename std::conditional< Const, typename Container::const_iterator, typename Container::iterator >::type |
| | The container iterator type (const/non-const) More...
|
| |
| using | reference = typename std::conditional< Const, typename Container::const_reference, typename Container::reference >::type |
| | The reference type (const/non-const) More...
|
| |
| enum | direction { NONE,
CLOCKWISE,
ANTICLOCKWISE
} |
| | Direction type enumeration. More...
|
| |
| bool | equal (const CirculatorIters< Container, Const > &rhs) |
| | Compare for equality. More...
|
| |
| void | increment () |
| | Move iterator forward. More...
|
| |
| void | decrement () |
| | Move iterator backward. More...
|
| |
template<class Container>
class Foam::Circulator< Container >
Walks over a container as if it were circular. The container must have the following members defined:
- size_type
- difference_type
- iterator / const_iterator
- reference / const_reference
Examples
Circulator<face> circ(
f);
if (!circ.empty())
{
do
{
*circ += 1;
Info<<
"Iterate forwards over face : " << *circ <<
endl;
} while (circ.circulate(CirculatorBase::FORWARD));
}
- Source files
-
Definition at line 351 of file Circulator.H.