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

RAII wrapper used to maintain and limit ppltask maximum inline schedule depth. This class will keep a reference to the depth slot on current context. More...

#include <concrt.h>

Public Member Functions

 _StackGuard ()
 
 _StackGuard (const _StackGuard &)=delete
 
_StackGuardoperator= (const _StackGuard &)=delete
 
 ~_StackGuard ()
 
bool _ShouldInline (_TaskInliningMode _InliningMode) const
 

Static Private Member Functions

static _CONCRTIMP size_t &__cdecl _GetCurrentInlineDepth ()
 Return a reference to the ppltask inline schedule depth slot on current context The inline depth will be set to 0 when the context is first initialized, and the caller is responsible to maintain that depth. More...
 

Private Attributes

size_t_Depth
 

Detailed Description

RAII wrapper used to maintain and limit ppltask maximum inline schedule depth. This class will keep a reference to the depth slot on current context.

Constructor & Destructor Documentation

Concurrency::details::_StackGuard::_StackGuard ( )
inline
5142  {
5143  // _Depth is the reference to the depth slot on context.
5144  ++_Depth;
5145  }
static _CONCRTIMP size_t &__cdecl _GetCurrentInlineDepth()
Return a reference to the ppltask inline schedule depth slot on current context The inline depth will...
size_t & _Depth
Definition: concrt.h:5163
Concurrency::details::_StackGuard::_StackGuard ( const _StackGuard )
delete
Concurrency::details::_StackGuard::~_StackGuard ( )
inline
5151  {
5152  // _Depth is the reference to the depth slot on context.
5153  --_Depth;
5154  }
size_t & _Depth
Definition: concrt.h:5163

Member Function Documentation

static _CONCRTIMP size_t& __cdecl Concurrency::details::_StackGuard::_GetCurrentInlineDepth ( )
staticprivate

Return a reference to the ppltask inline schedule depth slot on current context The inline depth will be set to 0 when the context is first initialized, and the caller is responsible to maintain that depth.

bool Concurrency::details::_StackGuard::_ShouldInline ( _TaskInliningMode  _InliningMode) const
inline
5157  {
5158  // As _TaskInliningMode is defined as inlining threshold, we can directly convert
5159  // it into size_t, and compare with current context inlining depth.
5160  return _Depth <= static_cast<size_t>(_InliningMode);
5161  }
_StackGuard& Concurrency::details::_StackGuard::operator= ( const _StackGuard )
delete

Member Data Documentation

size_t& Concurrency::details::_StackGuard::_Depth
private

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