StrideIterator< IntType > Class Template Reference

A random-access, integer-like, input iterator for integral values with a stride. If the stride is 1, the Foam::IndexIterator would be a better choice. More...

Inheritance diagram for StrideIterator< IntType >:
Collaboration diagram for StrideIterator< IntType >:

Public Types

typedef std::random_access_iterator_tag iterator_category
 
typedef IntType value_type
 
typedef IntType difference_type
 
typedef const IntType * pointer
 
typedef IntType reference
 

Public Member Functions

constexpr StrideIterator () noexcept
 Default construct as zero, stride 1. More...
 
constexpr StrideIterator (value_type val, value_type stride) noexcept
 Construct with specified value and stride. No checks (ie, possible to have a 0 stride!) More...
 
constexpr value_type operator* () const noexcept
 Return the value. More...
 
constexpr value_type operator[] (value_type n) const noexcept
 Offset dereference operator. More...
 
StrideIteratoroperator++ () noexcept
 Prefix increment. More...
 
StrideIterator operator++ (int) noexcept
 Postfix increment. More...
 
StrideIteratoroperator-- () noexcept
 Prefix decrement. More...
 
StrideIterator operator-- (int) noexcept
 Postfix decrement. More...
 
StrideIteratoroperator+= (value_type n) noexcept
 Arbitrary increment. More...
 
StrideIteratoroperator-= (value_type n) noexcept
 Arbitrary decrement. More...
 
constexpr StrideIterator operator+ (value_type n) const noexcept
 Return iterator with offset. More...
 
constexpr StrideIterator operator- (value_type n) const noexcept
 Return iterator with offset. More...
 
constexpr value_type operator- (const StrideIterator &iter) const noexcept
 Difference operator. More...
 
constexpr bool operator== (const StrideIterator &iter) const noexcept
 Test for equality of values (ignores stride) More...
 
constexpr bool operator< (const StrideIterator &iter) const noexcept
 Compare less-than values (ignores stride) More...
 
constexpr bool operator!= (const StrideIterator &iter) const noexcept
 
constexpr bool operator<= (const StrideIterator &iter) const noexcept
 
constexpr bool operator> (const StrideIterator &iter) const noexcept
 
constexpr bool operator>= (const StrideIterator &iter) const noexcept
 

Detailed Description

template<class IntType>
class Foam::StrideIterator< IntType >

A random-access, integer-like, input iterator for integral values with a stride. If the stride is 1, the Foam::IndexIterator would be a better choice.

Definition at line 181 of file StrideIterator.H.

Member Typedef Documentation

◆ iterator_category

typedef std::random_access_iterator_tag iterator_category

Definition at line 188 of file StrideIterator.H.

◆ value_type

typedef IntType value_type

Definition at line 189 of file StrideIterator.H.

◆ difference_type

typedef IntType difference_type

Definition at line 190 of file StrideIterator.H.

◆ pointer

typedef const IntType* pointer

Definition at line 191 of file StrideIterator.H.

◆ reference

typedef IntType reference

Definition at line 192 of file StrideIterator.H.

Constructor & Destructor Documentation

◆ StrideIterator() [1/2]

constexpr StrideIterator ( )
inlinenoexcept

Default construct as zero, stride 1.

Definition at line 200 of file StrideIterator.H.

◆ StrideIterator() [2/2]

constexpr StrideIterator ( value_type  val,
value_type  stride 
)
inlinenoexcept

Construct with specified value and stride. No checks (ie, possible to have a 0 stride!)

Definition at line 218 of file StrideIterator.H.

Member Function Documentation

◆ operator*()

constexpr value_type operator* ( ) const
inlinenoexcept

Return the value.

Definition at line 229 of file StrideIterator.H.

References StrideIndexer< IntType >::value().

Here is the call graph for this function:

◆ operator[]()

constexpr value_type operator[] ( value_type  n) const
inlinenoexcept

Offset dereference operator.

Definition at line 237 of file StrideIterator.H.

References n, and StrideIndexer< IntType >::value().

Here is the call graph for this function:

◆ operator++() [1/2]

StrideIterator& operator++ ( )
inlinenoexcept

Prefix increment.

Definition at line 245 of file StrideIterator.H.

References StrideIndexer< IntType >::next().

Here is the call graph for this function:

◆ operator++() [2/2]

StrideIterator operator++ ( int  )
inlinenoexcept

Postfix increment.

Definition at line 254 of file StrideIterator.H.

References StrideIndexer< IntType >::next().

Here is the call graph for this function:

◆ operator--() [1/2]

StrideIterator& operator-- ( )
inlinenoexcept

Prefix decrement.

Definition at line 264 of file StrideIterator.H.

References StrideIndexer< IntType >::prev().

Here is the call graph for this function:

◆ operator--() [2/2]

StrideIterator operator-- ( int  )
inlinenoexcept

Postfix decrement.

Definition at line 273 of file StrideIterator.H.

References StrideIndexer< IntType >::prev().

Here is the call graph for this function:

◆ operator+=()

StrideIterator& operator+= ( value_type  n)
inlinenoexcept

Arbitrary increment.

Definition at line 283 of file StrideIterator.H.

References n, and StrideIndexer< IntType >::next().

Here is the call graph for this function:

◆ operator-=()

StrideIterator& operator-= ( value_type  n)
inlinenoexcept

Arbitrary decrement.

Definition at line 292 of file StrideIterator.H.

References n, and StrideIndexer< IntType >::prev().

Here is the call graph for this function:

◆ operator+()

constexpr StrideIterator operator+ ( value_type  n) const
inlinenoexcept

Return iterator with offset.

Definition at line 302 of file StrideIterator.H.

References n, StrideIndexer< IntType >::stride(), and StrideIndexer< IntType >::value().

Here is the call graph for this function:

◆ operator-() [1/2]

constexpr StrideIterator operator- ( value_type  n) const
inlinenoexcept

Return iterator with offset.

Definition at line 311 of file StrideIterator.H.

References n, StrideIndexer< IntType >::stride(), and StrideIndexer< IntType >::value().

Here is the call graph for this function:

◆ operator-() [2/2]

constexpr value_type operator- ( const StrideIterator< IntType > &  iter) const
inlinenoexcept

Difference operator.

Definition at line 320 of file StrideIterator.H.

References StrideIndexer< IntType >::stride(), and StrideIndexer< IntType >::value().

Here is the call graph for this function:

◆ operator==()

constexpr bool operator== ( const StrideIterator< IntType > &  iter) const
inlinenoexcept

Test for equality of values (ignores stride)

Definition at line 337 of file StrideIterator.H.

References StrideIndexer< IntType >::value().

Here is the call graph for this function:

◆ operator<()

constexpr bool operator< ( const StrideIterator< IntType > &  iter) const
inlinenoexcept

Compare less-than values (ignores stride)

Definition at line 346 of file StrideIterator.H.

References StrideIndexer< IntType >::value().

Here is the call graph for this function:

◆ operator!=()

constexpr bool operator!= ( const StrideIterator< IntType > &  iter) const
inlinenoexcept

Definition at line 355 of file StrideIterator.H.

◆ operator<=()

constexpr bool operator<= ( const StrideIterator< IntType > &  iter) const
inlinenoexcept

Definition at line 361 of file StrideIterator.H.

◆ operator>()

constexpr bool operator> ( const StrideIterator< IntType > &  iter) const
inlinenoexcept

Definition at line 367 of file StrideIterator.H.

◆ operator>=()

constexpr bool operator>= ( const StrideIterator< IntType > &  iter) const
inlinenoexcept

Definition at line 373 of file StrideIterator.H.


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