Loading [MathJax]/extensions/TeX/newcommand.js
 deal.II version GIT relicensing-2972-g3b1da50de6 2025-03-29 20:10:00+00:00
\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}} \newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=} \newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]} \newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
Public Types | Public Member Functions | Private Attributes | Related Symbols | List of all members
SynchronousIterators< Iterators > Struct Template Reference

#include <deal.II/base/synchronous_iterator.h>

Public Types

using difference_type = std::size_t
 
using iterator_category = std::bidirectional_iterator_tag
 
using value_type = Iterators
 
using pointer = Iterators *
 
using reference = Iterators &
 

Public Member Functions

 SynchronousIterators (const Iterators &i)
 
const Iterators & operator* () const
 
Iterators & operator* ()
 

Private Attributes

Iterators iterators
 

Related Symbols

(Note that these are not member symbols.)

template<typename Iterators >
bool operator< (const SynchronousIterators< Iterators > &a, const SynchronousIterators< Iterators > &b)
 
template<typename Iterators >
std::size_t operator- (const SynchronousIterators< Iterators > &a, const SynchronousIterators< Iterators > &b)
 
template<typename I1 , typename I2 >
void advance (std::tuple< I1, I2 > &t, const unsigned int n)
 
template<typename I1 , typename I2 , typename I3 >
void advance (std::tuple< I1, I2, I3 > &t, const unsigned int n)
 
template<typename I1 , typename I2 , typename I3 , typename I4 >
void advance (std::tuple< I1, I2, I3, I4 > &t, const unsigned int n)
 
template<typename I1 , typename I2 >
void prev (std::tuple< I1, I2 > &t)
 
template<typename I1 , typename I2 , typename I3 >
void prev (std::tuple< I1, I2, I3 > &t)
 
template<typename I1 , typename I2 , typename I3 , typename I4 >
void prev (std::tuple< I1, I2, I3, I4 > &t)
 
template<typename I1 , typename I2 >
void advance_by_one (std::tuple< I1, I2 > &t)
 
template<typename I1 , typename I2 , typename I3 >
void advance_by_one (std::tuple< I1, I2, I3 > &t)
 
template<typename I1 , typename I2 , typename I3 , typename I4 >
void advance_by_one (std::tuple< I1, I2, I3, I4 > &t)
 
template<typename Iterators >
SynchronousIterators< Iterators > operator+ (const SynchronousIterators< Iterators > &a, const std::size_t n)
 
template<typename Iterators >
SynchronousIterators< Iterators > & operator++ (SynchronousIterators< Iterators > &a)
 
template<typename Iterators >
SynchronousIterators< Iterators > & operator-- (SynchronousIterators< Iterators > &a)
 
template<typename Iterators >
SynchronousIterators< Iterators > operator++ (SynchronousIterators< Iterators > &a, int)
 
template<typename Iterators >
bool operator!= (const SynchronousIterators< Iterators > &a, const SynchronousIterators< Iterators > &b)
 

Detailed Description

template<typename Iterators>
struct SynchronousIterators< Iterators >

A class that represents a set of iterators each of which are incremented by one at the same time. This is typically used in calls like std::transform(a.begin(), a.end(), b.begin(), functor); where we have synchronous iterators marching through the containers a,b. If an object of this type represents the end of a range, only the first element is considered (we only have a.end(), not b.end()). An example of how this class is used is given in step-35.

The template argument of the current class shall be of type std::tuple with arguments equal to the iterator types.

The individual iterators can be accessed using std::get<X>(synchronous_iterator.iterators) where X is the number corresponding to the desired iterator.

This type, and the helper functions associated with it, are used as the Value concept for the blocked_range type of the Threading Building Blocks.

Definition at line 49 of file synchronous_iterator.h.

Member Typedef Documentation

◆ difference_type

template<typename Iterators >
using SynchronousIterators< Iterators >::difference_type = std::size_t

The following traits are necessary for std::distance() to work with SynchronousIterators.

Definition at line 74 of file synchronous_iterator.h.

◆ iterator_category

template<typename Iterators >
using SynchronousIterators< Iterators >::iterator_category = std::bidirectional_iterator_tag

Definition at line 75 of file synchronous_iterator.h.

◆ value_type

template<typename Iterators >
using SynchronousIterators< Iterators >::value_type = Iterators

Definition at line 76 of file synchronous_iterator.h.

◆ pointer

template<typename Iterators >
using SynchronousIterators< Iterators >::pointer = Iterators *

Definition at line 77 of file synchronous_iterator.h.

◆ reference

template<typename Iterators >
using SynchronousIterators< Iterators >::reference = Iterators &

Definition at line 78 of file synchronous_iterator.h.

Constructor & Destructor Documentation

◆ SynchronousIterators()

template<typename Iterators >
SynchronousIterators< Iterators >::SynchronousIterators ( const Iterators &  i)
inline

Constructor.

Definition at line 90 of file synchronous_iterator.h.

Member Function Documentation

◆ operator*() [1/2]

template<typename Iterators >
const Iterators & SynchronousIterators< Iterators >::operator* ( ) const
inline

Dereference const operator. Returns a const reference to the iterators represented by the current class.

Definition at line 98 of file synchronous_iterator.h.

◆ operator*() [2/2]

template<typename Iterators >
Iterators & SynchronousIterators< Iterators >::operator* ( )
inline

Dereference operator. Returns a reference to the iterators represented by the current class.

Definition at line 107 of file synchronous_iterator.h.

Friends And Related Symbol Documentation

◆ operator<()

template<typename Iterators >
bool operator< ( const SynchronousIterators< Iterators > &  a,
const SynchronousIterators< Iterators > &  b 
)
related

Return whether the first element of the first argument is less than the first element of the second argument. Since the objects compared march forward all elements at the same time, comparing the first element is sufficient.

Definition at line 123 of file synchronous_iterator.h.

◆ operator-()

template<typename Iterators >
std::size_t operator- ( const SynchronousIterators< Iterators > &  a,
const SynchronousIterators< Iterators > &  b 
)
related

Return the distance between the first and the second argument. Since the objects compared march forward all elements at the same time, differencing the first element is sufficient.

Definition at line 141 of file synchronous_iterator.h.

◆ advance() [1/3]

template<typename I1 , typename I2 >
void advance ( std::tuple< I1, I2 > &  t,
const unsigned int  n 
)
related

Advance a tuple of iterators by n.

Definition at line 157 of file synchronous_iterator.h.

◆ advance() [2/3]

template<typename I1 , typename I2 , typename I3 >
void advance ( std::tuple< I1, I2, I3 > &  t,
const unsigned int  n 
)
related

Advance a tuple of iterators by n.

Definition at line 170 of file synchronous_iterator.h.

◆ advance() [3/3]

template<typename I1 , typename I2 , typename I3 , typename I4 >
void advance ( std::tuple< I1, I2, I3, I4 > &  t,
const unsigned int  n 
)
related

Advance a tuple of iterators by n.

Definition at line 184 of file synchronous_iterator.h.

◆ prev() [1/3]

template<typename I1 , typename I2 >
void prev ( std::tuple< I1, I2 > &  t)
related

Reverse a tuple of iterators by 1.

Definition at line 199 of file synchronous_iterator.h.

◆ prev() [2/3]

template<typename I1 , typename I2 , typename I3 >
void prev ( std::tuple< I1, I2, I3 > &  t)
related

Reverse a tuple of iterators by 1.

Definition at line 212 of file synchronous_iterator.h.

◆ prev() [3/3]

template<typename I1 , typename I2 , typename I3 , typename I4 >
void prev ( std::tuple< I1, I2, I3, I4 > &  t)
related

Reverse a tuple of iterators by 1.

Definition at line 226 of file synchronous_iterator.h.

◆ advance_by_one() [1/3]

template<typename I1 , typename I2 >
void advance_by_one ( std::tuple< I1, I2 > &  t)
related

Advance a tuple of iterators by 1.

Definition at line 241 of file synchronous_iterator.h.

◆ advance_by_one() [2/3]

template<typename I1 , typename I2 , typename I3 >
void advance_by_one ( std::tuple< I1, I2, I3 > &  t)
related

Advance a tuple of iterators by 1.

Definition at line 254 of file synchronous_iterator.h.

◆ advance_by_one() [3/3]

template<typename I1 , typename I2 , typename I3 , typename I4 >
void advance_by_one ( std::tuple< I1, I2, I3, I4 > &  t)
related

Advance a tuple of iterators by 1.

Definition at line 268 of file synchronous_iterator.h.

◆ operator+()

template<typename Iterators >
SynchronousIterators< Iterators > operator+ ( const SynchronousIterators< Iterators > &  a,
const std::size_t  n 
)
related

Advance the elements of this iterator by n.

Definition at line 283 of file synchronous_iterator.h.

◆ operator++() [1/2]

template<typename Iterators >
SynchronousIterators< Iterators > & operator++ ( SynchronousIterators< Iterators > &  a)
related

Advance the elements of this iterator by 1 (pre-increment).

Definition at line 297 of file synchronous_iterator.h.

◆ operator--()

template<typename Iterators >
SynchronousIterators< Iterators > & operator-- ( SynchronousIterators< Iterators > &  a)
related

Reverse the elements of this iterator by 1 (pre-decrement).

Definition at line 310 of file synchronous_iterator.h.

◆ operator++() [2/2]

template<typename Iterators >
SynchronousIterators< Iterators > operator++ ( SynchronousIterators< Iterators > &  a,
int   
)
related

Advance the elements of this iterator by 1 (post-increment).

Definition at line 323 of file synchronous_iterator.h.

◆ operator!=()

template<typename Iterators >
bool operator!= ( const SynchronousIterators< Iterators > &  a,
const SynchronousIterators< Iterators > &  b 
)
related

Compare synch iterators for inequality. Since they march in synch, comparing only the first element is sufficient.

Definition at line 338 of file synchronous_iterator.h.

Member Data Documentation

◆ iterators

template<typename Iterators >
Iterators SynchronousIterators< Iterators >::iterators
private

Storage for the iterators represented by the current class.

Definition at line 84 of file synchronous_iterator.h.


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