OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
SliceIterator< T > Class Template Reference

Iterator for array slice. More...

#include <SliceIterator.h>

Collaboration diagram for SliceIterator< T >:

Public Types

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

Public Member Functions

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

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

◆ SliceIterator() [2/2]

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

Definition at line 210 of file SliceIterator.h.

References cursor, SliceIterator(), and stride.

Here is the call graph for this function:

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 cursor, and SliceIterator().

Here is the call graph for this function:

◆ operator*()

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

Dereference.

Definition at line 289 of file SliceIterator.h.

References cursor.

◆ 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 SliceIterator().

Here is the call graph for this function:

◆ operator++() [1/2]

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

Increment (iterate forward).

Definition at line 233 of file SliceIterator.h.

References cursor, SliceIterator(), and stride.

Here is the call graph for this function:

◆ operator++() [2/2]

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

Increment (iterate forward).

Definition at line 239 of file SliceIterator.h.

References cursor, SliceIterator(), and stride.

Here is the call graph for this function:

◆ 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 cursor, SliceIterator(), and stride.

Here is the call graph for this function:

◆ 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 cursor, SliceIterator(), and stride.

Here is the call graph for this function:

◆ 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 SliceIterator().

Here is the call graph for this function:

◆ operator--() [1/2]

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

Decrement (iterate backward).

Definition at line 246 of file SliceIterator.h.

References cursor, SliceIterator(), and stride.

Here is the call graph for this function:

◆ operator--() [2/2]

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

Decrement (iterate backward).

Definition at line 252 of file SliceIterator.h.

References cursor, SliceIterator(), and stride.

Here is the call graph for this function:

◆ 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 cursor, SliceIterator(), and stride.

Here is the call graph for this function:

◆ operator=()

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

Definition at line 215 of file SliceIterator.h.

References cursor, SliceIterator(), and stride.

Here is the call graph for this function:

◆ operator==()

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

Definition at line 223 of file SliceIterator.h.

References cursor, and SliceIterator().

Here is the call graph for this function:

◆ operator[]()

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

Delegate.

Definition at line 294 of file SliceIterator.h.

References cursor, and stride.

Member Data Documentation

◆ cursor

◆ stride

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

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