VPTissue Reference Manual
SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R > Class Template Reference

Implementation of a circular iterator. More...

#include <CircularIteratorImpl.h>

Inheritance diagram for SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >:
Inheritance graph
Collaboration diagram for SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >:
Collaboration graph

Public Types

using base_type = T
 
using type = CircularIterator< T, V, P, R >
 

Public Member Functions

 CircularIterator (base_type b, base_type e, base_type i)
 Constructor requires range and start value. More...
 
base_type get () const
 Return underlying base type iterator. More...
 
 operator base_type () const
 Conversion to return iterator to its base type. More...
 
bool operator!= (const type &rhs) const
 Inequality test of the pointing iterator only, not of the range iterators. More...
 
bool operator!= (const base_type &rhs) const
 Inequality test of the pointing iterator only, not of the range iterators. More...
 
type::reference operator* () const
 Dereferencing operator. More...
 
typeoperator++ ()
 Pre-increment operator works circularly: at the end of the range it jumps back to the beginning and keeps going. More...
 
type operator++ (int)
 Post-increment operator works circularly: at the end of the range it jumps back to the beginning and keeps going. More...
 
typeoperator-- ()
 Pre-decrement operator works circularly: at the beginning of the range it jumps to the end and keeps going. More...
 
type operator-- (int)
 Post-decrement operator works circularly: at the beginning of the range it jumps to the end and keeps going. More...
 
type::pointer operator-> () const
 Structure dereferencing operator. More...
 
typeoperator= (const base_type &i)
 Assignment operator from base type to circularized iterator. More...
 
bool operator== (const type &rhs) const
 Equality test of the pointing iterator only, not of the range iterators. More...
 
bool operator== (const base_type &rhs) const
 Equality test of the pointing iterator only, not of the range iterators. More...
 

Protected Attributes

base_type m_begin
 
base_type m_end
 
base_type m_it
 

Detailed Description

template<typename T, typename V, typename P = V*, typename R = V&>
class SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >

Implementation of a circular iterator.

It will provide both const and non-const iterator.

Template parameters: T iterator type that gets wrapped to be circular. V value type of iterator T (and hence of its container). P pointer-to-V type (can be const qualified). R reference-to-V type (can be const qualified).

Definition at line 38 of file CircularIteratorImpl.h.

Constructor & Destructor Documentation

template<typename T, typename V, typename P = V*, typename R = V&>
SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::CircularIterator ( base_type  b,
base_type  e,
base_type  i 
)
inline

Constructor requires range and start value.

Parameters
bbegin iterator of the range
eend iterator of the range
istart iterator of circular sequencing

Definition at line 56 of file CircularIteratorImpl.h.

Member Function Documentation

template<typename T, typename V, typename P = V*, typename R = V&>
base_type SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::get ( ) const
inline

Return underlying base type iterator.

Returns
current value of iterator

Definition at line 65 of file CircularIteratorImpl.h.

template<typename T, typename V, typename P = V*, typename R = V&>
SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator base_type ( ) const
inlineexplicit

Conversion to return iterator to its base type.

Returns
current value of iterator

Definition at line 74 of file CircularIteratorImpl.h.

template<typename T, typename V, typename P = V*, typename R = V&>
bool SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator!= ( const type rhs) const
inline

Inequality test of the pointing iterator only, not of the range iterators.

Parameters
rhscircular iterator to compare with.
Returns
true iff current positions iterators coincide

Definition at line 190 of file CircularIteratorImpl.h.

References SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator==().

Here is the call graph for this function:

template<typename T, typename V, typename P = V*, typename R = V&>
bool SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator!= ( const base_type &  rhs) const
inline

Inequality test of the pointing iterator only, not of the range iterators.

Parameters
rhscircular iterator to compare with.
Returns
true iff current positions iterators coincide

Definition at line 201 of file CircularIteratorImpl.h.

References SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator==().

Here is the call graph for this function:

template<typename T, typename V, typename P = V*, typename R = V&>
type::reference SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator* ( ) const
inline

Dereferencing operator.

@ return reference (const / non-const depending on template parameters) to value pointed to by iterator.

Definition at line 94 of file CircularIteratorImpl.h.

Referenced by SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator->().

Here is the caller graph for this function:

template<typename T, typename V, typename P = V*, typename R = V&>
type& SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator++ ( )
inline

Pre-increment operator works circularly: at the end of the range it jumps back to the beginning and keeps going.

Returns
iterator after (circular) increment

Definition at line 114 of file CircularIteratorImpl.h.

template<typename T, typename V, typename P = V*, typename R = V&>
type SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator++ ( int  )
inline

Post-increment operator works circularly: at the end of the range it jumps back to the beginning and keeps going.

Returns
iterator before (circular) increment

Definition at line 128 of file CircularIteratorImpl.h.

template<typename T, typename V, typename P = V*, typename R = V&>
type& SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator-- ( )
inline

Pre-decrement operator works circularly: at the beginning of the range it jumps to the end and keeps going.

Returns
iterator after (circular) decrement

Definition at line 140 of file CircularIteratorImpl.h.

template<typename T, typename V, typename P = V*, typename R = V&>
type SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator-- ( int  )
inline

Post-decrement operator works circularly: at the beginning of the range it jumps to the end and keeps going.

Returns
iterator before (circular) decrement

Definition at line 154 of file CircularIteratorImpl.h.

template<typename T, typename V, typename P = V*, typename R = V&>
type::pointer SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator-> ( ) const
inline

Structure dereferencing operator.

Returns
pointer (const / non-const depending on template parameters) to value pointed to by iterator.

Definition at line 104 of file CircularIteratorImpl.h.

References SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator*().

Here is the call graph for this function:

template<typename T, typename V, typename P = V*, typename R = V&>
type& SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator= ( const base_type &  i)
inline

Assignment operator from base type to circularized iterator.

Returns
reference to iterator

Definition at line 83 of file CircularIteratorImpl.h.

template<typename T, typename V, typename P = V*, typename R = V&>
bool SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator== ( const type rhs) const
inline

Equality test of the pointing iterator only, not of the range iterators.

Parameters
rhscircular iterator to compare with.
Returns
true iff current positions iterators coincide

Definition at line 167 of file CircularIteratorImpl.h.

Referenced by SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator!=().

Here is the caller graph for this function:

template<typename T, typename V, typename P = V*, typename R = V&>
bool SimPT_Sim::Container::Impl_::CircularIterator< T, V, P, R >::operator== ( const base_type &  rhs) const
inline

Equality test of the pointing iterator only, not of the range iterators.

Parameters
rhscircular iterator to compare with.
Returns
true iff current positions iterators coincide

Definition at line 179 of file CircularIteratorImpl.h.


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