STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Member Functions | Private Attributes | List of all members
Concurrency::_Range< _Index_type > Class Template Reference

#include <ppl.h>

Public Member Functions

 _Range (_Index_type _Current_iteration, _Index_type _Last_iteration)
 
void _Send_range (_Range< _Index_type > *_Helper_range)
 
void _Steal_range (_Range< _Index_type > *_Helper_range)
 
_Index_type _Number_of_iterations () const
 
_Index_type _Get_current_iteration () const
 
void _Set_current_iteration (const _Index_type _I)
 
 __declspec (property(get=_Get_current_iteration, put=_Set_current_iteration)) _Index_type _M_current_iteration
 
_Index_type _Get_last_iteration () const
 
void _Set_last_iteration (const _Index_type _I)
 
 __declspec (property(get=_Get_last_iteration, put=_Set_last_iteration)) _Index_type _M_last_iteration
 

Private Attributes

volatile _Index_type _M_current
 
volatile _Index_type _M_last
 

Constructor & Destructor Documentation

template<typename _Index_type>
Concurrency::_Range< _Index_type >::_Range ( _Index_type  _Current_iteration,
_Index_type  _Last_iteration 
)
inline
1814  :
1815  _M_current(_Current_iteration), _M_last(_Last_iteration)
1816  {
1817  // On creation, the range shall have at least 1 iteration.
1819  }
volatile _Index_type _M_current
Definition: ppl.h:1893
#define _CONCRT_ASSERT(x)
Definition: concrt.h:137
_Index_type _Number_of_iterations() const
Definition: ppl.h:1856
volatile _Index_type _M_last
Definition: ppl.h:1894

Member Function Documentation

template<typename _Index_type>
Concurrency::_Range< _Index_type >::__declspec ( property(get=_Get_current_iteration, put=_Set_current_iteration )
template<typename _Index_type>
Concurrency::_Range< _Index_type >::__declspec ( property(get=_Get_last_iteration, put=_Set_last_iteration )
template<typename _Index_type>
_Index_type Concurrency::_Range< _Index_type >::_Get_current_iteration ( ) const
inline
1863  {
1864  return _M_current;
1865  }
volatile _Index_type _M_current
Definition: ppl.h:1893
template<typename _Index_type>
_Index_type Concurrency::_Range< _Index_type >::_Get_last_iteration ( ) const
inline
1877  {
1878  return _M_last;
1879  }
volatile _Index_type _M_last
Definition: ppl.h:1894
template<typename _Index_type>
_Index_type Concurrency::_Range< _Index_type >::_Number_of_iterations ( ) const
inline
1857  {
1858  return (_M_last_iteration - _M_current_iteration);
1859  }
template<typename _Index_type>
void Concurrency::_Range< _Index_type >::_Send_range ( _Range< _Index_type > *  _Helper_range)
inline
1823  {
1824  // If there are no iterations other than the current one left until finish, there is no help
1825  // needed. Set the pointer to a special value that helper will understand and continue
1826  // doing the work.
1827  _Index_type _Remaining_iterations = _Number_of_iterations();
1828  if (_Remaining_iterations > 1)
1829  {
1830  // Compute the two pieces of the work range: one for the worker and one for helper class.
1831  _M_last_iteration = _M_current_iteration + _Remaining_iterations / 2;
1832 
1833  // There needs to be at least 1 iteration left because the current iteration cannot be sent.
1835  }
1836 
1837  // This is also a signal for the helper that a range has been sent to it.
1838  _Helper_range->_M_current_iteration = _M_last_iteration;
1839  }
#define _CONCRT_ASSERT(x)
Definition: concrt.h:137
_Index_type _Number_of_iterations() const
Definition: ppl.h:1856
template<typename _Index_type>
void Concurrency::_Range< _Index_type >::_Set_current_iteration ( const _Index_type  _I)
inline
1869  {
1870  _M_current = _I;
1871  }
volatile _Index_type _M_current
Definition: ppl.h:1893
template<typename _Index_type>
void Concurrency::_Range< _Index_type >::_Set_last_iteration ( const _Index_type  _I)
inline
1883  {
1884  _M_last = _I;
1885  }
volatile _Index_type _M_last
Definition: ppl.h:1894
template<typename _Index_type>
void Concurrency::_Range< _Index_type >::_Steal_range ( _Range< _Index_type > *  _Helper_range)
inline
1843  {
1844  // We allow stealing only from a range that has atleast 1 iteration
1846 
1847  _Index_type _Current_iter = _M_current_iteration;
1848 
1849  _Helper_range->_M_current_iteration = _Current_iter + 1;
1850  _Helper_range->_M_last_iteration = _M_last_iteration;
1851 
1852  _M_last_iteration = _Current_iter + 1;
1853  }
#define _CONCRT_ASSERT(x)
Definition: concrt.h:137
_Index_type _Number_of_iterations() const
Definition: ppl.h:1856

Member Data Documentation

template<typename _Index_type>
volatile _Index_type Concurrency::_Range< _Index_type >::_M_current
private
template<typename _Index_type>
volatile _Index_type Concurrency::_Range< _Index_type >::_M_last
private

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