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

Iterator for array slice. More...

#include <SliceIterator.h>

Collaboration diagram for ConstSliceIterator< T >:

Public Types

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

Public Member Functions

 ConstSliceIterator (const T *array, std::ptrdiff_t stride)
 Constructor.
 ConstSliceIterator (const ConstSliceIterator< T > &rhs)
ConstSliceIterator< T > & operator= (const ConstSliceIterator< T > &)
bool operator== (const ConstSliceIterator< T > &rhs) const
bool operator!= (const ConstSliceIterator< T > &rhs) const
ConstSliceIterator< T > & operator++ ()
 Increment (iterate forward).
ConstSliceIterator< T > operator++ (int)
 Increment (iterate forward).
ConstSliceIterator< T > & operator-- ()
 Decrement (iterate backward).
ConstSliceIterator< T > operator-- (int)
 Decrement (iterate backward).
ConstSliceIterator< T > & operator+= (std::ptrdiff_t)
 Add multiple stride and assign.
ConstSliceIterator< T > & operator-= (std::ptrdiff_t)
 Subtract multiple stride and assign.
ConstSliceIterator< T > operator+ (std::ptrdiff_t) const
 Add multiple stride.
ConstSliceIterator< T > operator- (std::ptrdiff_t) const
 Subtract multiple stride.
difference_type operator- (const ConstSliceIterator< T > &) const
 Get pointer difference.
const T & operator* () const
 Dereference.
const T & operator[] (int) const
 Delegate.

Private Attributes

const T * cursor
std::ptrdiff_t stride

Detailed Description

template<class T>
class ConstSliceIterator< T >

Iterator for array slice.

Definition at line 107 of file SliceIterator.h.

Member Typedef Documentation

◆ difference_type

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

The pointer difference type.

Definition at line 118 of file SliceIterator.h.

◆ iterator_category

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

The iterator tag, taken from the standard template library.

Definition at line 112 of file SliceIterator.h.

◆ pointer

template<class T>
typedef const T* ConstSliceIterator< T >::pointer

The pointer type.

Definition at line 121 of file SliceIterator.h.

◆ reference

template<class T>
typedef const T& ConstSliceIterator< T >::reference

The reference type.

Definition at line 124 of file SliceIterator.h.

◆ value_type

template<class T>
typedef const T ConstSliceIterator< T >::value_type

The value type.

Definition at line 115 of file SliceIterator.h.

Constructor & Destructor Documentation

◆ ConstSliceIterator() [1/2]

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

◆ ConstSliceIterator() [2/2]

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

Definition at line 309 of file SliceIterator.h.

References ConstSliceIterator(), cursor, and stride.

Here is the call graph for this function:

Member Function Documentation

◆ operator!=()

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

Definition at line 329 of file SliceIterator.h.

References ConstSliceIterator(), and cursor.

Here is the call graph for this function:

◆ operator*()

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

Dereference.

Definition at line 393 of file SliceIterator.h.

References cursor.

◆ operator+()

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

Add multiple stride.

Definition at line 375 of file SliceIterator.h.

References ConstSliceIterator().

Here is the call graph for this function:

◆ operator++() [1/2]

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

Increment (iterate forward).

Definition at line 335 of file SliceIterator.h.

References ConstSliceIterator(), cursor, and stride.

Here is the call graph for this function:

◆ operator++() [2/2]

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

Increment (iterate forward).

Definition at line 341 of file SliceIterator.h.

References ConstSliceIterator(), cursor, and stride.

Here is the call graph for this function:

◆ operator+=()

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

Add multiple stride and assign.

Definition at line 361 of file SliceIterator.h.

References ConstSliceIterator(), cursor, and stride.

Here is the call graph for this function:

◆ operator-() [1/2]

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

Get pointer difference.

Definition at line 388 of file SliceIterator.h.

References ConstSliceIterator(), cursor, and stride.

Here is the call graph for this function:

◆ operator-() [2/2]

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

Subtract multiple stride.

Definition at line 381 of file SliceIterator.h.

References ConstSliceIterator().

Here is the call graph for this function:

◆ operator--() [1/2]

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

Decrement (iterate backward).

Definition at line 348 of file SliceIterator.h.

References ConstSliceIterator(), cursor, and stride.

Here is the call graph for this function:

◆ operator--() [2/2]

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

Decrement (iterate backward).

Definition at line 354 of file SliceIterator.h.

References ConstSliceIterator(), cursor, and stride.

Here is the call graph for this function:

◆ operator-=()

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

Subtract multiple stride and assign.

Definition at line 368 of file SliceIterator.h.

References ConstSliceIterator(), cursor, and stride.

Here is the call graph for this function:

◆ operator=()

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

Definition at line 315 of file SliceIterator.h.

References ConstSliceIterator(), cursor, and stride.

Here is the call graph for this function:

◆ operator==()

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

Definition at line 323 of file SliceIterator.h.

References ConstSliceIterator(), and cursor.

Here is the call graph for this function:

◆ operator[]()

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

Delegate.

Definition at line 398 of file SliceIterator.h.

References cursor, and stride.

Member Data Documentation

◆ cursor

◆ stride

template<class T>
std::ptrdiff_t ConstSliceIterator< T >::stride
mutableprivate

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