Marray
Public Types | Public Member Functions | Friends | List of all members
andres::Iterator< T, isConst, A > Class Template Reference

STL-compliant random access iterator for View and Marray. More...

#include <marray.hxx>

Public Types

typedef
std::random_access_iterator_tag 
iterator_category
typedef T value_type
typedef std::ptrdiff_t difference_type
typedef marray_detail::IfBool
< isConst, const T *, T * >
::type 
pointer
typedef marray_detail::IfBool
< isConst, const T &, T & >
::type 
reference
typedef marray_detail::IfBool
< isConst, const View< T, true,
A > *, View< T, false, A >
* >::type 
view_pointer
typedef marray_detail::IfBool
< isConst, const View< T, true,
A > &, View< T, false, A >
& >::type 
view_reference

Public Member Functions

 Iterator ()
 Empty constructor.
 Iterator (const View< T, false, A > &, const std::size_t=0)
 Construct from View on mutable data.
 Iterator (View< T, false, A > &, const std::size_t=0)
 Construct from View on mutable data.
 Iterator (const View< T, true, A > &, const std::size_t=0)
 Construct from View on constant data.
 Iterator (const Iterator< T, false, A > &)
 Copy constructor or conversion from an Iterator on mutable data.
reference operator* () const
 De-reference.
pointer operator-> () const
 Pointer.
reference operator[] (const std::size_t) const
 Element access.
Iterator< T, isConst, A > & operator+= (const difference_type &)
Iterator< T, isConst, A > & operator-= (const difference_type &)
Iterator< T, isConst, A > & operator++ ()
 Prefix increment.
Iterator< T, isConst, A > & operator-- ()
 Prefix decrement.
Iterator< T, isConst, A > operator++ (int)
 Postfix increment.
Iterator< T, isConst, A > operator-- (int)
 Postfix decrement.
Iterator< T, isConst, A > operator+ (const difference_type &) const
Iterator< T, isConst, A > operator- (const difference_type &) const
template<bool isConstLocal>
difference_type operator- (const Iterator< T, isConstLocal, A > &) const
template<bool isConstLocal>
bool operator== (const Iterator< T, isConstLocal, A > &) const
template<bool isConstLocal>
bool operator!= (const Iterator< T, isConstLocal, A > &) const
template<bool isConstLocal>
bool operator< (const Iterator< T, isConstLocal, A > &) const
template<bool isConstLocal>
bool operator> (const Iterator< T, isConstLocal, A > &) const
template<bool isConstLocal>
bool operator<= (const Iterator< T, isConstLocal, A > &) const
template<bool isConstLocal>
bool operator>= (const Iterator< T, isConstLocal, A > &) const
bool hasMore () const
 Fast alternative to comparing with the end iterator.
std::size_t index () const
 Get the corresponding index in the View.
template<class CoordinateIterator >
void coordinate (CoordinateIterator) const
 Get the corresponding coordinate sequence in the View.

Friends

class Marray< T, A >
class Iterator< T,!isConst, A >

Detailed Description

template<class T, bool isConst, class A>
class andres::Iterator< T, isConst, A >

STL-compliant random access iterator for View and Marray.

In addition to the STL iterator interface, the member functions hasMore(), index(), and coordinate() are defined.

Definition at line 472 of file marray.hxx.

Member Typedef Documentation

template<class T, bool isConst, class A>
typedef std::ptrdiff_t andres::Iterator< T, isConst, A >::difference_type

Definition at line 478 of file marray.hxx.

template<class T, bool isConst, class A>
typedef std::random_access_iterator_tag andres::Iterator< T, isConst, A >::iterator_category

Definition at line 476 of file marray.hxx.

template<class T, bool isConst, class A>
typedef marray_detail::IfBool<isConst, const T*, T*>::type andres::Iterator< T, isConst, A >::pointer

Definition at line 479 of file marray.hxx.

template<class T, bool isConst, class A>
typedef marray_detail::IfBool<isConst, const T&, T&>::type andres::Iterator< T, isConst, A >::reference

Definition at line 480 of file marray.hxx.

template<class T, bool isConst, class A>
typedef T andres::Iterator< T, isConst, A >::value_type

Definition at line 477 of file marray.hxx.

template<class T, bool isConst, class A>
typedef marray_detail::IfBool<isConst, const View<T, true, A>*, View<T, false, A>*>::type andres::Iterator< T, isConst, A >::view_pointer

Definition at line 484 of file marray.hxx.

template<class T, bool isConst, class A>
typedef marray_detail::IfBool<isConst, const View<T, true, A>&, View<T, false, A>&>::type andres::Iterator< T, isConst, A >::view_reference

Definition at line 486 of file marray.hxx.

Constructor & Destructor Documentation

template<class T , bool isConst, class A >
andres::Iterator< T, isConst, A >::Iterator ( )
inline

Empty constructor.

Definition at line 3899 of file marray.hxx.

template<class T, bool isConst, class A>
andres::Iterator< T, isConst, A >::Iterator ( const View< T, false, A > &  view,
const std::size_t  index = 0 
)
inline

Construct from View on mutable data.

Parameters
viewView
indexIndex into the View.

Definition at line 3968 of file marray.hxx.

template<class T, bool isConst, class A>
andres::Iterator< T, isConst, A >::Iterator ( View< T, false, A > &  view,
const std::size_t  index = 0 
)
inline

Construct from View on mutable data.

Parameters
viewView
indexIndex into the View.

Definition at line 4022 of file marray.hxx.

template<class T, bool isConst, class A>
andres::Iterator< T, isConst, A >::Iterator ( const View< T, true, A > &  view,
const std::size_t  index = 0 
)
inline

Construct from View on constant data.

Parameters
viewView
indexIndex into the View.

Definition at line 3915 of file marray.hxx.

template<class T, bool isConst, class A>
andres::Iterator< T, isConst, A >::Iterator ( const Iterator< T, false, A > &  in)
inline

Copy constructor or conversion from an Iterator on mutable data.

Definition at line 4073 of file marray.hxx.

Member Function Documentation

template<class T , bool isConst, class A >
template<class CoordinateIterator >
void andres::Iterator< T, isConst, A >::coordinate ( CoordinateIterator< T, isConst, A >  it) const
inline

Get the corresponding coordinate sequence in the View.

Parameters
itIterator into a container starting from which the coordinate sequence is to be written (output).

Definition at line 4480 of file marray.hxx.

template<class T , bool isConst, class A >
bool andres::Iterator< T, isConst, A >::hasMore ( ) const
inline

Fast alternative to comparing with the end iterator.

Returns
Boolean indicator.

Definition at line 4454 of file marray.hxx.

template<class T , bool isConst, class A >
std::size_t andres::Iterator< T, isConst, A >::index ( ) const
inline

Get the corresponding index in the View.

Returns
index Index.

Definition at line 4466 of file marray.hxx.

template<class T, bool isConst, class A>
template<bool isConstLocal>
bool andres::Iterator< T, isConst, A >::operator!= ( const Iterator< T, isConstLocal, A > &  it) const
inline

Definition at line 4385 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A >::reference andres::Iterator< T, isConst, A >::operator* ( ) const
inline

De-reference.

Definition at line 4088 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A > andres::Iterator< T, isConst, A >::operator+ ( const difference_type x) const
inline

Definition at line 4332 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A > & andres::Iterator< T, isConst, A >::operator++ ( )
inline

Prefix increment.

Definition at line 4183 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A > andres::Iterator< T, isConst, A >::operator++ ( int  )
inline

Postfix increment.

Definition at line 4309 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A > & andres::Iterator< T, isConst, A >::operator+= ( const difference_type x)
inline

Definition at line 4120 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A > andres::Iterator< T, isConst, A >::operator- ( const difference_type x) const
inline

Definition at line 4345 of file marray.hxx.

template<class T, bool isConst, class A>
template<bool isConstLocal>
Iterator< T, isConst, A >::difference_type andres::Iterator< T, isConst, A >::operator- ( const Iterator< T, isConstLocal, A > &  it) const
inline

Definition at line 4359 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A > & andres::Iterator< T, isConst, A >::operator-- ( )
inline

Prefix decrement.

Definition at line 4247 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A > andres::Iterator< T, isConst, A >::operator-- ( int  )
inline

Postfix decrement.

Definition at line 4321 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A > & andres::Iterator< T, isConst, A >::operator-= ( const difference_type x)
inline

Definition at line 4161 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A >::pointer andres::Iterator< T, isConst, A >::operator-> ( ) const
inline

Pointer.

Definition at line 4098 of file marray.hxx.

template<class T, bool isConst, class A>
template<bool isConstLocal>
bool andres::Iterator< T, isConst, A >::operator< ( const Iterator< T, isConstLocal, A > &  it) const
inline

Definition at line 4400 of file marray.hxx.

template<class T, bool isConst, class A>
template<bool isConstLocal>
bool andres::Iterator< T, isConst, A >::operator<= ( const Iterator< T, isConstLocal, A > &  it) const
inline

Definition at line 4426 of file marray.hxx.

template<class T, bool isConst, class A>
template<bool isConstLocal>
bool andres::Iterator< T, isConst, A >::operator== ( const Iterator< T, isConstLocal, A > &  it) const
inline

Definition at line 4372 of file marray.hxx.

template<class T, bool isConst, class A>
template<bool isConstLocal>
bool andres::Iterator< T, isConst, A >::operator> ( const Iterator< T, isConstLocal, A > &  it) const
inline

Definition at line 4413 of file marray.hxx.

template<class T, bool isConst, class A>
template<bool isConstLocal>
bool andres::Iterator< T, isConst, A >::operator>= ( const Iterator< T, isConstLocal, A > &  it) const
inline

Definition at line 4439 of file marray.hxx.

template<class T , bool isConst, class A >
Iterator< T, isConst, A >::reference andres::Iterator< T, isConst, A >::operator[] ( const std::size_t  x) const
inline

Element access.

Definition at line 4109 of file marray.hxx.

Friends And Related Function Documentation

template<class T, bool isConst, class A>
friend class Iterator< T,!isConst, A >
friend

Definition at line 540 of file marray.hxx.

template<class T, bool isConst, class A>
friend class Marray< T, A >
friend

Definition at line 539 of file marray.hxx.