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

typedef unsigned long long Concurrency::simple_partitioner::_Size_type
private

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.
1682  : _M_chunk_size(_Chunk_size)
1683  {
1684  if (_Chunk_size == 0)
1685  {
1686  throw std::invalid_argument("_Chunk_size");
1687  }
1688  }
_Size_type _M_chunk_size
Definition: ppl.h:1712
Concurrency::simple_partitioner::~simple_partitioner ( )
inline

Destroys a simple_partitioner object.

1694 {}

Member Function Documentation

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

Member Data Documentation

_Size_type Concurrency::simple_partitioner::_M_chunk_size
private

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