sliceRange Class Reference

A set of labels defined by a start, a length and a stride. More...

Classes

class  const_iterator
 Bidirectional input iterator with const access. More...
 
class  const_reverse_iterator
 Bidirectional reverse input iterator with const access. More...
 
class  indexer
 A value indexer, for iteration or generation. More...
 

Public Types

typedef label value_type
 Type of values the range contains. More...
 
typedef label size_type
 The type that can represent the size of the range. More...
 

Public Member Functions

constexpr sliceRange () noexcept
 Default construct an empty slice (0,0,0) More...
 
constexpr sliceRange (const label beg, const label len, const label stride) noexcept
 Construct slice from start/size/stride, no checks. More...
 
 sliceRange (const FixedList< label, 3 > &coeffs)
 
constexpr label start () const noexcept
 The first/start value in the range (inclusive) More...
 
constexpr label size () const noexcept
 The size of the range. More...
 
constexpr label stride () const noexcept
 The stride for the range. More...
 
bool empty () const noexcept
 True if range is empty (zero-sized) More...
 
constexpr label first () const noexcept
 The first/start value in the range (inclusive) More...
 
label last () const noexcept
 The (inclusive) upper value of the range. More...
 
List< label > labels () const
 Return list of labels corresponding to the slice. More...
 
label operator[] (const label i) const noexcept
 Return element in the range, without bounds checking. More...
 
 operator bool () const noexcept
 True if range is non-empty. More...
 
indexer generator () const
 Return a forward values generator. More...
 
const_iterator at (const label i) const
 
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 beyond the end of the range. More...
 
const_iterator end () const noexcept
 A const_iterator set to 1 beyond the end of the range. More...
 
const_reverse_iterator rbegin () const noexcept
 A const_reverse_iterator set to 1 before the end of range. More...
 
const_reverse_iterator crbegin () const noexcept
 A const_reverse_iterator set to 1 before the end of range. More...
 
const_reverse_iterator rend () const noexcept
 A const_reverse_iterator set to 1 before the begin of range. More...
 
const_reverse_iterator crend () const noexcept
 A const_reverse_iterator set to 1 before the begin of range. More...
 

Detailed Description

A set of labels defined by a start, a length and a stride.

Source files

Definition at line 58 of file sliceRange.H.

Member Typedef Documentation

◆ value_type

typedef label value_type

Type of values the range contains.

Definition at line 77 of file sliceRange.H.

◆ size_type

typedef label size_type

The type that can represent the size of the range.

Definition at line 80 of file sliceRange.H.

Constructor & Destructor Documentation

◆ sliceRange() [1/3]

constexpr sliceRange ( )
inlineconstexprnoexcept

Default construct an empty slice (0,0,0)

Definition at line 32 of file sliceRangeI.H.

◆ sliceRange() [2/3]

constexpr sliceRange ( const label  beg,
const label  len,
const label  stride 
)
inlineconstexprnoexcept

Construct slice from start/size/stride, no checks.

Definition at line 40 of file sliceRangeI.H.

◆ sliceRange() [3/3]

sliceRange ( const FixedList< label, 3 > &  coeffs)
explicit

Construct slice from start/size/stride coefficients, enforce non-negative size and stride.

Definition at line 36 of file sliceRange.C.

Member Function Documentation

◆ start()

constexpr label start ( ) const
inlineconstexprnoexcept

The first/start value in the range (inclusive)

Definition at line 115 of file sliceRange.H.

◆ size()

constexpr label size ( ) const
inlineconstexprnoexcept

The size of the range.

Definition at line 121 of file sliceRange.H.

Referenced by Foam::operator==().

Here is the caller graph for this function:

◆ stride()

constexpr label stride ( ) const
inlineconstexprnoexcept

The stride for the range.

Definition at line 127 of file sliceRange.H.

Referenced by Foam::operator==().

Here is the caller graph for this function:

◆ empty()

bool empty ( ) const
inlinenoexcept

True if range is empty (zero-sized)

Definition at line 133 of file sliceRange.H.

◆ first()

constexpr label first ( ) const
inlineconstexprnoexcept

The first/start value in the range (inclusive)

Definition at line 139 of file sliceRange.H.

Referenced by Foam::operator==().

Here is the caller graph for this function:

◆ last()

label last ( ) const
inlinenoexcept

The (inclusive) upper value of the range.

Definition at line 145 of file sliceRange.H.

◆ labels()

Foam::List< Foam::label > labels ( ) const

Return list of labels corresponding to the slice.

Definition at line 46 of file sliceRange.C.

References UList< T >::begin(), and UList< T >::end().

Here is the call graph for this function:

◆ operator[]()

label operator[] ( const label  i) const
inlinenoexcept

Return element in the range, without bounds checking.

Definition at line 157 of file sliceRange.H.

◆ operator bool()

operator bool ( ) const
inlineexplicitnoexcept

True if range is non-empty.

Definition at line 163 of file sliceRange.H.

References bool.

◆ generator()

Foam::sliceRange::indexer generator ( ) const
inline

Return a forward values generator.

Definition at line 298 of file sliceRangeI.H.

◆ at()

Foam::sliceRange::const_iterator at ( const label  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 305 of file sliceRangeI.H.

◆ begin()

Foam::sliceRange::const_iterator begin ( ) const
inlinenoexcept

A const_iterator set to the beginning of the range.

Definition at line 317 of file sliceRangeI.H.

◆ cbegin()

Foam::sliceRange::const_iterator cbegin ( ) const
inlinenoexcept

A const_iterator set to the beginning of the range.

Definition at line 324 of file sliceRangeI.H.

◆ cend()

Foam::sliceRange::const_iterator cend ( ) const
inlinenoexcept

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

Definition at line 338 of file sliceRangeI.H.

◆ end()

Foam::sliceRange::const_iterator end ( ) const
inlinenoexcept

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

Definition at line 331 of file sliceRangeI.H.

◆ rbegin()

Foam::sliceRange::const_reverse_iterator rbegin ( ) const
inlinenoexcept

A const_reverse_iterator set to 1 before the end of range.

Definition at line 345 of file sliceRangeI.H.

◆ crbegin()

Foam::sliceRange::const_reverse_iterator crbegin ( ) const
inlinenoexcept

A const_reverse_iterator set to 1 before the end of range.

Definition at line 352 of file sliceRangeI.H.

◆ rend()

Foam::sliceRange::const_reverse_iterator rend ( ) const
inlinenoexcept

A const_reverse_iterator set to 1 before the begin of range.

Definition at line 359 of file sliceRangeI.H.

◆ crend()

Foam::sliceRange::const_reverse_iterator crend ( ) const
inlinenoexcept

A const_reverse_iterator set to 1 before the begin of range.

Definition at line 366 of file sliceRangeI.H.


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