Reference documentation for deal.II version Git 01fb814 2017-08-18 21:00:44 -0500
Public Member Functions | Private Attributes | Related Functions | List of all members
SynchronousIterators< Iterators > Struct Template Reference

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

Public Member Functions

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

Private Attributes

Iterators iterators
 

Related Functions

(Note that these are not member functions.)

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 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 >
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())

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.

Author
Wolfgang Bangerth, 2008

Definition at line 51 of file synchronous_iterator.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 87 of file synchronous_iterator.h.

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

Copy constructor.

Definition at line 96 of file synchronous_iterator.h.

Member Function Documentation

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 106 of file synchronous_iterator.h.

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

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

Definition at line 116 of file synchronous_iterator.h.

Friends And Related Function Documentation

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 134 of file synchronous_iterator.h.

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 152 of file synchronous_iterator.h.

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 170 of file synchronous_iterator.h.

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 184 of file synchronous_iterator.h.

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 200 of file synchronous_iterator.h.

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 218 of file synchronous_iterator.h.

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 231 of file synchronous_iterator.h.

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 246 of file synchronous_iterator.h.

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 264 of file synchronous_iterator.h.

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

Advance the elements of this iterator by 1.

Definition at line 280 of file synchronous_iterator.h.

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 296 of file synchronous_iterator.h.

Member Data Documentation

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

Storage for the iterators represented by the current class.

Definition at line 79 of file synchronous_iterator.h.


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