C++ mpi module for stochmagnet_main Package
Public Types | Public Member Functions | Friends | List of all members
CORE_StrideIterator< Ptr_Type, Step > Class Template Reference

this class describes a const iterator with a constant stride 2 templates parameter: More...

#include <CORE_StrideIterator.h>

Public Types

typedef std::iterator_traits< Ptr_Type >::value_type value_type
 copy value type
 
typedef std::iterator_traits< Ptr_Type >::reference reference
 reference value type
 
typedef std::iterator_traits< Ptr_Type >::pointer pointer
 pointer value type
 
typedef std::iterator_traits< Ptr_Type >::difference_type difference_type
 displacement type
 
typedef std::random_access_iterator_tag iterator_category
 type of iterator
 

Public Member Functions

 CORE_StrideIterator ()
 default constructor
 
 CORE_StrideIterator (Ptr_Type x)
 initializer constructor More...
 
 CORE_StrideIterator (const self &x)
 copy constructor More...
 
reference operator* ()
 return the pointer of the iterator More...
 
reference operator[] (difference_type n)
 access to n-th element of the list More...
 
selfoperator+= (difference_type x)
 move the iterator on x elements More...
 
selfoperator++ ()
 return the next element and set the iterator to next element
 
self operator++ (int s)
 return the current element and set the iterator to next element More...
 
selfoperator-- ()
 return the previous element and set the iterator to previous element
 
self operator-- (int s)
 return the current element and set the iterator to previous element More...
 

Friends

self operator+ (self x, difference_type y)
 add y element to x iterator : x:=x+y More...
 
self operator+ (difference_type x, self y)
 add x elements to y iterator : y:=y+x More...
 
difference_type operator- (self x, self y)
 return the number of difference elements number between 2 iterators More...
 
bool operator== (self x, self y)
 compare the 2 iterator if equal More...
 
bool operator!= (self x, self y)
 compare the 2 iterator if not equal More...
 
bool operator< (self x, self y)
 compare the 2 iterators on same values More...
 

Detailed Description

template<class Ptr_Type, tInt Step>
class CORE_StrideIterator< Ptr_Type, Step >

this class describes a const iterator with a constant stride 2 templates parameter:

Constructor & Destructor Documentation

◆ CORE_StrideIterator() [1/2]

template<class Ptr_Type , tInt Step>
CORE_StrideIterator< Ptr_Type, Step >::CORE_StrideIterator ( Ptr_Type  x)
inlineexplicit

initializer constructor

Parameters
[in]xinitialize value

◆ CORE_StrideIterator() [2/2]

template<class Ptr_Type , tInt Step>
CORE_StrideIterator< Ptr_Type, Step >::CORE_StrideIterator ( const self x)
inline

copy constructor

Parameters
[in]x: iterator to copy

Member Function Documentation

◆ operator*()

template<class Ptr_Type , tInt Step>
reference CORE_StrideIterator< Ptr_Type, Step >::operator* ( )
inline

return the pointer of the iterator

Returns
the pointer of the iterator

◆ operator++()

template<class Ptr_Type , tInt Step>
self CORE_StrideIterator< Ptr_Type, Step >::operator++ ( int  s)
inline

return the current element and set the iterator to next element

Parameters
[in]s: number of elements to jump (not used)

◆ operator+=()

template<class Ptr_Type , tInt Step>
self& CORE_StrideIterator< Ptr_Type, Step >::operator+= ( difference_type  x)
inline

move the iterator on x elements

Parameters
[in]xmoved elements number

◆ operator--()

template<class Ptr_Type , tInt Step>
self CORE_StrideIterator< Ptr_Type, Step >::operator-- ( int  s)
inline

return the current element and set the iterator to previous element

Parameters
[in]s: number of elements to jump (not used)

◆ operator[]()

template<class Ptr_Type , tInt Step>
reference CORE_StrideIterator< Ptr_Type, Step >::operator[] ( difference_type  n)
inline

access to n-th element of the list

Returns
a reference to n-the elementof the list example: (*this)[3]-> (*this)[0]+ 3 * S

Friends And Related Function Documentation

◆ operator!=

template<class Ptr_Type , tInt Step>
bool operator!= ( self  x,
self  y 
)
friend

compare the 2 iterator if not equal

Parameters
[in]xfirst iterator to compare
[in]ysecond iterator to compare

◆ operator+ [1/2]

template<class Ptr_Type , tInt Step>
self operator+ ( difference_type  x,
self  y 
)
friend

add x elements to y iterator : y:=y+x

Parameters
[in]xnumber of elements to add
[in]yiterator
Returns
y

◆ operator+ [2/2]

template<class Ptr_Type , tInt Step>
self operator+ ( self  x,
difference_type  y 
)
friend

add y element to x iterator : x:=x+y

Parameters
[in]xiterator
[in]ynumber of elements to add
Returns
x

◆ operator-

template<class Ptr_Type , tInt Step>
difference_type operator- ( self  x,
self  y 
)
friend

return the number of difference elements number between 2 iterators

Parameters
[in]xfirst iterator to compare
[in]ysecond iterator to compare

◆ operator<

template<class Ptr_Type , tInt Step>
bool operator< ( self  x,
self  y 
)
friend

compare the 2 iterators on same values

Parameters
[in]xfirst iterator to compare
[in]ysecond iterator to compare

◆ operator==

template<class Ptr_Type , tInt Step>
bool operator== ( self  x,
self  y 
)
friend

compare the 2 iterator if equal

Parameters
[in]xfirst iterator to compare
[in]ysecond iterator to compare

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