STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
Concurrency::_Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size > Class Template Reference

#include <ppl.h>

Public Types

typedef std::iterator_traits< _Forward_iterator >::value_type _Value_type
 

Public Member Functions

 _Parallel_for_each_helper (_Forward_iterator &_First, const _Forward_iterator &_Last, const _Function &_Func)
 
void operator() () const
 

Static Public Attributes

static const unsigned int _Size = _Chunk_size
 

Private Member Functions

_Parallel_for_each_helper const & operator= (_Parallel_for_each_helper const &)
 

Private Attributes

const _Function & _M_function
 
std::iterator_traits< _Forward_iterator >::pointer _M_element [_Size]
 
unsigned int _M_len
 

Member Typedef Documentation

template<typename _Forward_iterator, typename _Function, unsigned int _Chunk_size>
typedef std::iterator_traits<_Forward_iterator>::value_type Concurrency::_Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size >::_Value_type

Constructor & Destructor Documentation

template<typename _Forward_iterator, typename _Function, unsigned int _Chunk_size>
Concurrency::_Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size >::_Parallel_for_each_helper ( _Forward_iterator &  _First,
const _Forward_iterator &  _Last,
const _Function &  _Func 
)
inline
2776  :
2777  _M_function(_Func), _M_len(0)
2778  {
2779  static_assert(std::is_lvalue_reference<decltype(*_First)>::value, "lvalue required for forward iterator operator *");
2780  // Add a batch of work items to this functor's array
2781  for (unsigned int _Index=0; (_Index < _Size) && (_First != _Last); _Index++)
2782  {
2783  _M_element[_M_len++] = &(*_First++);
2784  }
2785  }
unsigned int _M_len
Definition: ppl.h:2802
static const unsigned int _Size
Definition: ppl.h:2774
std::iterator_traits< _Forward_iterator >::pointer _M_element[_Size]
Definition: ppl.h:2801
const _Function & _M_function
Definition: ppl.h:2800
_FwdIt _Last
Definition: algorithm:1936

Member Function Documentation

template<typename _Forward_iterator, typename _Function, unsigned int _Chunk_size>
void Concurrency::_Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size >::operator() ( ) const
inline
2788  {
2789  // Invoke parallel_for on the batched up array of elements
2790  _Parallel_for_impl(0U, _M_len, 1U,
2791  [this] (unsigned int _Index)
2792  {
2793  _M_function(*(_M_element[_Index]));
2794  }
2795  );
2796  }
void _Parallel_for_impl(_Index_type _First, _Index_type _Last, _Index_type _Step, const _Function &_Func, _Partitioner &&_Part)
Definition: ppl.h:2477
unsigned int _M_len
Definition: ppl.h:2802
std::iterator_traits< _Forward_iterator >::pointer _M_element[_Size]
Definition: ppl.h:2801
const _Function & _M_function
Definition: ppl.h:2800
template<typename _Forward_iterator, typename _Function, unsigned int _Chunk_size>
_Parallel_for_each_helper const& Concurrency::_Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size >::operator= ( _Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size > const &  )
private

Member Data Documentation

template<typename _Forward_iterator, typename _Function, unsigned int _Chunk_size>
std::iterator_traits<_Forward_iterator>::pointer Concurrency::_Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size >::_M_element[_Size]
private
template<typename _Forward_iterator, typename _Function, unsigned int _Chunk_size>
const _Function& Concurrency::_Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size >::_M_function
private
template<typename _Forward_iterator, typename _Function, unsigned int _Chunk_size>
unsigned int Concurrency::_Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size >::_M_len
private
template<typename _Forward_iterator, typename _Function, unsigned int _Chunk_size>
const unsigned int Concurrency::_Parallel_for_each_helper< _Forward_iterator, _Function, _Chunk_size >::_Size = _Chunk_size
static

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