StrideRange< IntType > Class Template Reference

A tuple of integrals comprising start, size, stride. Caution: not properly tested for use with negative strides! More...

Inheritance diagram for StrideRange< IntType >:

Public Types

typedef IntType value_type
 Type of values the range contains. More...
 
typedef IntType size_type
 The type that can represent the size of the range. More...
 
using const_iterator = StrideIterator< IntType >
 Input iterator with const access. More...
 
using const_reverse_iterator = RevStrideIterator< IntType >
 Reverse input iterator with const access. More...
 

Public Member Functions

constexpr StrideRange () noexcept
 Default construct an empty stride range (0,0,0) More...
 
constexpr StrideRange (IntType beg, IntType len, IntType stride) noexcept
 Construct start/size/stride, no checks. More...
 
constexpr bool empty () const noexcept
 True if range is empty (zero-sized) More...
 
constexpr IntType size () const noexcept
 The size of the range (number of items) More...
 
constexpr IntType & size () noexcept
 Non-const access to size of the range (number of items) More...
 
constexpr IntType start () const noexcept
 The (inclusive) lower value of the range. More...
 
constexpr IntType & start () noexcept
 Non-const access to start of the range. More...
 
constexpr IntType stride () const noexcept
 The stride of the range. More...
 
constexpr IntType & stride () noexcept
 Non-const access to the stride. More...
 
constexpr IntType min () const noexcept
 The (inclusive) lower value of the range, same as start(), begin_value() More...
 
constexpr IntType max () const noexcept
 The (inclusive) upper value of the range, same as rbegin_value(). Ill-defined for an empty range. More...
 
constexpr IntType operator[] (IntType i) const noexcept
 Offset dereference, without bounds checking Return element in the range, without bounds checking. More...
 
template<class IntT2 >
constexpr bool operator== (const StrideRange< IntT2 > &other) const noexcept
 Test for equality of start/size/stride values. More...
 
template<class IntT2 >
constexpr bool operator< (const StrideRange< IntT2 > &other) const noexcept
 Compare lexicographically: compares start, size, stride. More...
 
template<class IntT2 >
constexpr bool operator!= (const StrideRange< IntT2 > &other) const noexcept
 
template<class IntT2 >
constexpr bool operator<= (const StrideRange< IntT2 > &other) const noexcept
 
template<class IntT2 >
constexpr bool operator> (const StrideRange< IntT2 > &other) const noexcept
 
template<class IntT2 >
constexpr bool operator>= (const StrideRange< IntT2 > &other) const noexcept
 
constexpr IntType begin_value () const noexcept
 The value at the beginning of the range - same as start() More...
 
constexpr IntType end_value () const noexcept
 The value that is one stride beyond the end of the range. More...
 
constexpr IntType rbegin_value () const noexcept
 The max value of the end of start/size range. More...
 
constexpr IntType rend_value () const noexcept
 The value that is one stride before the begin of start/size range. More...
 
StrideIndexer< IntType > generator () const noexcept
 Return a forward values generator. More...
 
const_iterator at (IntType i) const
 Return const_iterator to a position within the range, with bounds checking. More...
 
const_iterator begin () const noexcept
 A const_iterator set to the beginning of the range. More...
 
const_iterator cbegin () const noexcept
 A const_iterator set to the beginning of the range. More...
 
const_iterator cend () const noexcept
 A const_iterator set to 1 stride beyond the end of the range. More...
 
const_iterator end () const noexcept
 A const_iterator set to 1 stride beyond the end of the range. More...
 
const_reverse_iterator rbegin () const noexcept
 A const_reverse_iterator set to 1 stride before the end of range. More...
 
const_reverse_iterator crbegin () const noexcept
 A const_reverse_iterator set to 1 stride before the end of range. More...
 
const_reverse_iterator rend () const noexcept
 A const_reverse_iterator set to 1 stride before the begin of range. More...
 
const_reverse_iterator crend () const noexcept
 A const_reverse_iterator set to 1 stride before the begin of range. More...
 

Detailed Description

template<class IntType>
class Foam::StrideRange< IntType >

A tuple of integrals comprising start, size, stride. Caution: not properly tested for use with negative strides!

Source files

Definition at line 47 of file StrideRange.H.

Member Typedef Documentation

◆ value_type

typedef IntType value_type

Type of values the range contains.

Definition at line 114 of file StrideRange.H.

◆ size_type

typedef IntType size_type

The type that can represent the size of the range.

Definition at line 119 of file StrideRange.H.

◆ const_iterator

using const_iterator = StrideIterator<IntType>

Input iterator with const access.

Definition at line 124 of file StrideRange.H.

◆ const_reverse_iterator

Reverse input iterator with const access.

Definition at line 129 of file StrideRange.H.

Constructor & Destructor Documentation

◆ StrideRange() [1/2]

constexpr StrideRange ( )
inlinenoexcept

Default construct an empty stride range (0,0,0)

Definition at line 55 of file StrideRangeI.H.

◆ StrideRange() [2/2]

constexpr StrideRange ( IntType  beg,
IntType  len,
IntType  stride 
)
inlinenoexcept

Construct start/size/stride, no checks.

Definition at line 65 of file StrideRangeI.H.

Member Function Documentation

◆ empty()

constexpr bool empty ( ) const
inlinenoexcept

True if range is empty (zero-sized)

Definition at line 163 of file StrideRange.H.

◆ size() [1/2]

constexpr IntType size ( ) const
inlinenoexcept

The size of the range (number of items)

Definition at line 168 of file StrideRange.H.

◆ size() [2/2]

constexpr IntType& size ( )
inlinenoexcept

Non-const access to size of the range (number of items)

Definition at line 173 of file StrideRange.H.

◆ start() [1/2]

constexpr IntType start ( ) const
inlinenoexcept

The (inclusive) lower value of the range.

Definition at line 178 of file StrideRange.H.

◆ start() [2/2]

constexpr IntType& start ( )
inlinenoexcept

Non-const access to start of the range.

Definition at line 183 of file StrideRange.H.

◆ stride() [1/2]

constexpr IntType stride ( ) const
inlinenoexcept

The stride of the range.

Definition at line 188 of file StrideRange.H.

◆ stride() [2/2]

constexpr IntType& stride ( )
inlinenoexcept

Non-const access to the stride.

Definition at line 193 of file StrideRange.H.

◆ min()

constexpr IntType min ( ) const
inlinenoexcept

The (inclusive) lower value of the range, same as start(), begin_value()

Definition at line 199 of file StrideRange.H.

◆ max()

constexpr IntType max ( ) const
inlinenoexcept

The (inclusive) upper value of the range, same as rbegin_value(). Ill-defined for an empty range.

Definition at line 205 of file StrideRange.H.

◆ operator[]()

constexpr IntType operator[] ( IntType  i) const
inlinenoexcept

Offset dereference, without bounds checking Return element in the range, without bounds checking.

Definition at line 128 of file StrideRangeI.H.

◆ operator==()

constexpr bool operator== ( const StrideRange< IntT2 > &  other) const
inlinenoexcept

Test for equality of start/size/stride values.

Definition at line 137 of file StrideRangeI.H.

◆ operator<()

constexpr bool operator< ( const StrideRange< IntT2 > &  other) const
inlinenoexcept

Compare lexicographically: compares start, size, stride.

Definition at line 234 of file StrideRange.H.

◆ operator!=()

constexpr bool operator!= ( const StrideRange< IntT2 > &  other) const
inlinenoexcept

Definition at line 242 of file StrideRange.H.

◆ operator<=()

constexpr bool operator<= ( const StrideRange< IntT2 > &  other) const
inlinenoexcept

Definition at line 249 of file StrideRange.H.

◆ operator>()

constexpr bool operator> ( const StrideRange< IntT2 > &  other) const
inlinenoexcept

Definition at line 256 of file StrideRange.H.

◆ operator>=()

constexpr bool operator>= ( const StrideRange< IntT2 > &  other) const
inlinenoexcept

Definition at line 263 of file StrideRange.H.

◆ begin_value()

constexpr IntType begin_value ( ) const
inlinenoexcept

The value at the beginning of the range - same as start()

Definition at line 94 of file StrideRangeI.H.

Referenced by StrideRange< label >::begin(), and StrideRange< label >::cbegin().

Here is the caller graph for this function:

◆ end_value()

constexpr IntType end_value ( ) const
inlinenoexcept

The value that is one stride beyond the end of the range.

Definition at line 102 of file StrideRangeI.H.

Referenced by StrideRange< label >::cend(), and StrideRange< label >::end().

Here is the caller graph for this function:

◆ rbegin_value()

constexpr IntType rbegin_value ( ) const
inlinenoexcept

The max value of the end of start/size range.

Definition at line 110 of file StrideRangeI.H.

Referenced by StrideRange< label >::crbegin(), StrideRange< label >::max(), and StrideRange< label >::rbegin().

Here is the caller graph for this function:

◆ rend_value()

constexpr IntType rend_value ( ) const
inlinenoexcept

The value that is one stride before the begin of start/size range.

Definition at line 118 of file StrideRangeI.H.

Referenced by StrideRange< label >::crend(), and StrideRange< label >::rend().

Here is the caller graph for this function:

◆ generator()

StrideIndexer<IntType> generator ( ) const
inlinenoexcept

Return a forward values generator.

Definition at line 297 of file StrideRange.H.

◆ at()

const_iterator at ( IntType  i) const
inline

Return const_iterator to a position within the range, with bounds checking.

Returns
iterator at the requested position, or end() for out-of-bounds

Definition at line 309 of file StrideRange.H.

◆ begin()

const_iterator begin ( ) const
inlinenoexcept

A const_iterator set to the beginning of the range.

Definition at line 317 of file StrideRange.H.

◆ cbegin()

const_iterator cbegin ( ) const
inlinenoexcept

A const_iterator set to the beginning of the range.

Definition at line 325 of file StrideRange.H.

◆ cend()

const_iterator cend ( ) const
inlinenoexcept

A const_iterator set to 1 stride beyond the end of the range.

Definition at line 333 of file StrideRange.H.

◆ end()

const_iterator end ( ) const
inlinenoexcept

A const_iterator set to 1 stride beyond the end of the range.

Definition at line 341 of file StrideRange.H.

◆ rbegin()

const_reverse_iterator rbegin ( ) const
inlinenoexcept

A const_reverse_iterator set to 1 stride before the end of range.

Definition at line 349 of file StrideRange.H.

◆ crbegin()

const_reverse_iterator crbegin ( ) const
inlinenoexcept

A const_reverse_iterator set to 1 stride before the end of range.

Definition at line 357 of file StrideRange.H.

◆ rend()

const_reverse_iterator rend ( ) const
inlinenoexcept

A const_reverse_iterator set to 1 stride before the begin of range.

Definition at line 365 of file StrideRange.H.

◆ crend()

const_reverse_iterator crend ( ) const
inlinenoexcept

A const_reverse_iterator set to 1 stride before the begin of range.

Definition at line 373 of file StrideRange.H.


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