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
2772  :
2773  _M_function(_Func), _M_len(0)
2774  {
2775  static_assert(std::is_lvalue_reference<decltype(*_First)>::value, "lvalue required for forward iterator operator *");
2776  // Add a batch of work items to this functor's array
2777  for (unsigned int _Index=0; (_Index < _Size) && (_First != _Last); _Index++)
2778  {
2779  _M_element[_M_len++] = &(*_First++);
2780  }
2781  }
unsigned int _M_len
Definition: ppl.h:2798
_In_ size_t _In_ int _Index
Definition: time.h:102
static const unsigned int _Size
Definition: ppl.h:2770
std::iterator_traits< _Forward_iterator >::pointer _M_element[_Size]
Definition: ppl.h:2797
const _Function & _M_function
Definition: ppl.h:2796
_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
2784  {
2785  // Invoke parallel_for on the batched up array of elements
2786  _Parallel_for_impl(0U, _M_len, 1U,
2787  [this] (unsigned int _Index)
2788  {
2789  _M_function(*(_M_element[_Index]));
2790  }
2791  );
2792  }
void _Parallel_for_impl(_Index_type _First, _Index_type _Last, _Index_type _Step, const _Function &_Func, _Partitioner &&_Part)
Definition: ppl.h:2473
unsigned int _M_len
Definition: ppl.h:2798
_In_ size_t _In_ int _Index
Definition: time.h:102
std::iterator_traits< _Forward_iterator >::pointer _M_element[_Size]
Definition: ppl.h:2797
const _Function & _M_function
Definition: ppl.h:2796
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: