OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
Public Types | Public Member Functions | Private Attributes | List of all members
SliceIterator< T > Class Template Reference

Iterator for array slice. More...

#include <SliceIterator.h>

Public Types

typedef std::random_access_iterator_tag iterator_category
 The iterator tag, taken from the standard template library. More...
 
typedef T value_type
 The value type. More...
 
typedef std::ptrdiff_t difference_type
 The pointer difference type. More...
 
typedef T * pointer
 The pointer type. More...
 
typedef T & reference
 The reference type. More...
 

Public Member Functions

 SliceIterator (T *array, std::ptrdiff_t stride)
 Constructor. More...
 
 SliceIterator (const SliceIterator< T > &)
 
SliceIterator< T > & operator= (const SliceIterator< T > &)
 
bool operator== (const SliceIterator< T > &rhs) const
 
bool operator!= (const SliceIterator< T > &rhs) const
 
SliceIterator< T > & operator++ ()
 Increment (iterate forward). More...
 
SliceIterator< T > operator++ (int)
 Increment (iterate forward). More...
 
SliceIterator< T > & operator-- ()
 Decrement (iterate backward). More...
 
SliceIterator< T > operator-- (int)
 Decrement (iterate backward). More...
 
SliceIterator< T > & operator+= (std::ptrdiff_t)
 Increment by multiple stride. More...
 
SliceIterator< T > & operator-= (std::ptrdiff_t)
 Decrement by multiple stride. More...
 
SliceIterator< T > operator+ (std::ptrdiff_t)
 Add multiple stride. More...
 
SliceIterator< T > operator- (std::ptrdiff_t)
 Subtract multiple stride. More...
 
difference_type operator- (const SliceIterator< T > &) const
 Difference. More...
 
T & operator* () const
 Dereference. More...
 
T & operator[] (int) const
 Delegate. More...
 

Private Attributes

T * cursor
 
std::ptrdiff_t stride
 

Detailed Description

template<class T>
class SliceIterator< T >

Iterator for array slice.

Definition at line 32 of file SliceIterator.h.

Member Typedef Documentation

◆ difference_type

template<class T >
typedef std::ptrdiff_t SliceIterator< T >::difference_type

The pointer difference type.

Definition at line 43 of file SliceIterator.h.

◆ iterator_category

template<class T >
typedef std::random_access_iterator_tag SliceIterator< T >::iterator_category

The iterator tag, taken from the standard template library.

Definition at line 37 of file SliceIterator.h.

◆ pointer

template<class T >
typedef T* SliceIterator< T >::pointer

The pointer type.

Definition at line 46 of file SliceIterator.h.

◆ reference

template<class T >
typedef T& SliceIterator< T >::reference

The reference type.

Definition at line 49 of file SliceIterator.h.

◆ value_type

template<class T >
typedef T SliceIterator< T >::value_type

The value type.

Definition at line 40 of file SliceIterator.h.

Constructor & Destructor Documentation

◆ SliceIterator() [1/2]

template<class T >
SliceIterator< T >::SliceIterator ( T *  array,
std::ptrdiff_t  stride 
)
inline

Constructor.

Definition at line 205 of file SliceIterator.h.

◆ SliceIterator() [2/2]

template<class T >
SliceIterator< T >::SliceIterator ( const SliceIterator< T > &  rhs)
inline

Definition at line 210 of file SliceIterator.h.

Member Function Documentation

◆ operator!=()

template<class T >
bool SliceIterator< T >::operator!= ( const SliceIterator< T > &  rhs) const
inline

Definition at line 228 of file SliceIterator.h.

References SliceIterator< T >::cursor.

◆ operator*()

template<class T >
T & SliceIterator< T >::operator*
inline

Dereference.

Definition at line 289 of file SliceIterator.h.

◆ operator+()

template<class T >
SliceIterator< T > SliceIterator< T >::operator+ ( std::ptrdiff_t  n)
inline

Add multiple stride.

Definition at line 271 of file SliceIterator.h.

References Hypervolume::n.

◆ operator++() [1/2]

template<class T >
SliceIterator< T > & SliceIterator< T >::operator++
inline

Increment (iterate forward).

Definition at line 233 of file SliceIterator.h.

◆ operator++() [2/2]

template<class T >
SliceIterator< T > SliceIterator< T >::operator++ ( int  )
inline

Increment (iterate forward).

Definition at line 239 of file SliceIterator.h.

◆ operator+=()

template<class T >
SliceIterator< T > & SliceIterator< T >::operator+= ( std::ptrdiff_t  n)
inline

Increment by multiple stride.

Definition at line 259 of file SliceIterator.h.

References Hypervolume::n.

◆ operator-() [1/2]

template<class T >
SliceIterator< T >::difference_type SliceIterator< T >::operator- ( const SliceIterator< T > &  rhs) const
inline

Difference.

Definition at line 284 of file SliceIterator.h.

References SliceIterator< T >::cursor.

◆ operator-() [2/2]

template<class T >
SliceIterator< T > SliceIterator< T >::operator- ( std::ptrdiff_t  n)
inline

Subtract multiple stride.

Definition at line 277 of file SliceIterator.h.

References Hypervolume::n.

◆ operator--() [1/2]

template<class T >
SliceIterator< T > & SliceIterator< T >::operator--
inline

Decrement (iterate backward).

Definition at line 246 of file SliceIterator.h.

◆ operator--() [2/2]

template<class T >
SliceIterator< T > SliceIterator< T >::operator-- ( int  )
inline

Decrement (iterate backward).

Definition at line 252 of file SliceIterator.h.

◆ operator-=()

template<class T >
SliceIterator< T > & SliceIterator< T >::operator-= ( std::ptrdiff_t  n)
inline

Decrement by multiple stride.

Definition at line 265 of file SliceIterator.h.

References Hypervolume::n.

◆ operator=()

template<class T >
SliceIterator< T > & SliceIterator< T >::operator= ( const SliceIterator< T > &  rhs)
inline

Definition at line 215 of file SliceIterator.h.

References SliceIterator< T >::cursor.

◆ operator==()

template<class T >
bool SliceIterator< T >::operator== ( const SliceIterator< T > &  rhs) const
inline

Definition at line 223 of file SliceIterator.h.

References SliceIterator< T >::cursor.

◆ operator[]()

template<class T >
T & SliceIterator< T >::operator[] ( int  n) const
inline

Delegate.

Definition at line 294 of file SliceIterator.h.

References Hypervolume::n.

Member Data Documentation

◆ cursor

template<class T >
T* SliceIterator< T >::cursor
private

◆ stride

template<class T >
std::ptrdiff_t SliceIterator< T >::stride
private

Definition at line 96 of file SliceIterator.h.


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