STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Types | Private Attributes | List of all members
Concurrency::simple_partitioner Class Reference

The simple_partitioner class represents a static partitioning of the range iterated over by parallel_for. The partitioner divides the range into chunks such that each chunk has at least the number of iterations specified by the chunk size. More...

#include <ppl.h>

Public Member Functions

 simple_partitioner (_Size_type _Chunk_size)
 Constructs a simple_partitioner object. More...
 
 ~simple_partitioner ()
 Destroys a simple_partitioner object. More...
 
template<class _Type >
_Type _Get_num_chunks (_Type _Range_arg) const
 

Private Types

typedef unsigned long long _Size_type
 

Private Attributes

_Size_type _M_chunk_size
 

Detailed Description

The simple_partitioner class represents a static partitioning of the range iterated over by parallel_for. The partitioner divides the range into chunks such that each chunk has at least the number of iterations specified by the chunk size.

Member Typedef Documentation

Constructor & Destructor Documentation

Concurrency::simple_partitioner::simple_partitioner ( _Size_type  _Chunk_size)
inlineexplicit

Constructs a simple_partitioner object.

Parameters
_M_chunk_sizeNumber of iterations per chunk.
1683  : _M_chunk_size(_Chunk_size)
1684  {
1685  if (_Chunk_size == 0)
1686  {
1687  throw std::invalid_argument("_Chunk_size");
1688  }
1689  }
_Size_type _M_chunk_size
Definition: ppl.h:1713
Concurrency::simple_partitioner::~simple_partitioner ( )
inline

Destroys a simple_partitioner object.

1695 {}

Member Function Documentation

template<class _Type >
_Type Concurrency::simple_partitioner::_Get_num_chunks ( _Type  _Range_arg) const
inline
1699  {
1700  static_assert(sizeof(_Type) <= sizeof(_Size_type), "Potential truncation of _Range_arg");
1701  _Size_type _Num_chunks = (static_cast<_Size_type>(_Range_arg) / _M_chunk_size);
1702 
1703  if (_Num_chunks == 0)
1704  {
1705  _Num_chunks = 1;
1706  }
1707 
1708  return static_cast<_Type>(_Num_chunks);
1709  }
_In_ wctype_t _Type
Definition: corecrt_wctype.h:111
unsigned long long _Size_type
Definition: ppl.h:1673
_Size_type _M_chunk_size
Definition: ppl.h:1713

Member Data Documentation

_Size_type Concurrency::simple_partitioner::_M_chunk_size
private

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