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

#include <ppltasks.h>

Inheritance diagram for Concurrency::details::_ContextCallback:
Concurrency::task_continuation_context

Public Member Functions

 ~_ContextCallback ()
 
 _ContextCallback (bool _DeferCapture=false)
 
void _Resolve (bool _CaptureCurrent)
 
 _ContextCallback (const _ContextCallback &_Src)
 
 _ContextCallback (_ContextCallback &&_Src)
 
_ContextCallbackoperator= (const _ContextCallback &_Src)
 
_ContextCallbackoperator= (_ContextCallback &&_Src)
 
bool _HasCapturedContext () const
 
bool operator== (const _ContextCallback &_Rhs) const
 
bool operator!= (const _ContextCallback &_Rhs) const
 
_CRTIMP2 void __thiscall _CallInContext (_CallbackFunction _Func, bool _IgnoreDisconnect) const
 
void _CallInContext (_CallbackFunction _Func) const
 

Static Public Member Functions

static _ContextCallback _CaptureCurrent ()
 

Private Types

typedef std::function< void __cdecl(void)> _CallbackFunction
 

Private Member Functions

_CRTIMP2 void __thiscall _Reset ()
 
_CRTIMP2 void __thiscall _Assign (void *_PContextCallback)
 
_CRTIMP2 void __thiscall _Capture ()
 

Static Private Member Functions

static _CRTIMP2 bool __cdecl _IsCurrentOriginSTA ()
 

Private Attributes

union {
   void *   _M_pContextCallback
 
   size_t   _M_captureMethod
 
_M_context
 

Static Private Attributes

static const size_t _S_captureDeferred = 1
 

Member Typedef Documentation

typedef std::function<void __cdecl (void)> Concurrency::details::_ContextCallback::_CallbackFunction
private

Constructor & Destructor Documentation

Concurrency::details::_ContextCallback::~_ContextCallback ( )
inline
511  {
512  _Reset();
513  }
_CRTIMP2 void __thiscall _Reset()
Concurrency::details::_ContextCallback::_ContextCallback ( bool  _DeferCapture = false)
inline
516  {
517  if (_DeferCapture)
518  {
519  _M_context._M_captureMethod = _S_captureDeferred;
520  }
521  else
522  {
523  _M_context._M_pContextCallback = nullptr;
524  }
525  }
static const size_t _S_captureDeferred
Definition: ppltasks.h:615
union Concurrency::details::_ContextCallback::@100 _M_context
Concurrency::details::_ContextCallback::_ContextCallback ( const _ContextCallback _Src)
inline
544  {
545  _Assign(_Src._M_context._M_pContextCallback);
546  }
_CRTIMP2 void __thiscall _Assign(void *_PContextCallback)
_In_ size_t _Out_opt_ int _In_z_ unsigned char const * _Src
Definition: mbstring.h:1039
Concurrency::details::_ContextCallback::_ContextCallback ( _ContextCallback &&  _Src)
inline
549  {
550  _M_context._M_pContextCallback = _Src._M_context._M_pContextCallback;
551  _Src._M_context._M_pContextCallback = nullptr;
552  }
union Concurrency::details::_ContextCallback::@100 _M_context
_In_ size_t _Out_opt_ int _In_z_ unsigned char const * _Src
Definition: mbstring.h:1039

Member Function Documentation

_CRTIMP2 void __thiscall Concurrency::details::_ContextCallback::_Assign ( void _PContextCallback)
private
_CRTIMP2 void __thiscall Concurrency::details::_ContextCallback::_CallInContext ( _CallbackFunction  _Func,
bool  _IgnoreDisconnect 
) const
void Concurrency::details::_ContextCallback::_CallInContext ( _CallbackFunction  _Func) const
inline
595  {
596  _CallInContext(_Func, false);
597  }
_CRTIMP2 void __thiscall _CallInContext(_CallbackFunction _Func, bool _IgnoreDisconnect) const
_CRTIMP2 void __thiscall Concurrency::details::_ContextCallback::_Capture ( )
private
static _ContextCallback Concurrency::details::_ContextCallback::_CaptureCurrent ( )
inlinestatic
504  {
506  _Context._Capture();
507  return _Context;
508  }
_ContextCallback(bool _DeferCapture=false)
Definition: ppltasks.h:515
_Check_return_ _In_z_ wchar_t const _Inout_opt_ _Deref_prepost_opt_z_ wchar_t ** _Context
Definition: corecrt_wstring.h:228
bool Concurrency::details::_ContextCallback::_HasCapturedContext ( ) const
inline
575  {
576  _ASSERTE(_M_context._M_captureMethod != _S_captureDeferred);
577  return (_M_context._M_pContextCallback != nullptr);
578  }
static const size_t _S_captureDeferred
Definition: ppltasks.h:615
#define _ASSERTE(expr)
Definition: crtdbg.h:707
union Concurrency::details::_ContextCallback::@100 _M_context
static _CRTIMP2 bool __cdecl Concurrency::details::_ContextCallback::_IsCurrentOriginSTA ( )
staticprivate
_CRTIMP2 void __thiscall Concurrency::details::_ContextCallback::_Reset ( )
private
void Concurrency::details::_ContextCallback::_Resolve ( bool  _CaptureCurrent)
inline
529  {
530  if(_M_context._M_captureMethod == _S_captureDeferred)
531  {
532  _M_context._M_pContextCallback = nullptr;
533 
535  {
536  _Capture();
537  }
538  }
539  }
static const size_t _S_captureDeferred
Definition: ppltasks.h:615
union Concurrency::details::_ContextCallback::@100 _M_context
static _CRTIMP2 bool __cdecl _IsCurrentOriginSTA()
static _ContextCallback _CaptureCurrent()
Definition: ppltasks.h:503
_CRTIMP2 void __thiscall _Capture()
bool Concurrency::details::_ContextCallback::operator!= ( const _ContextCallback _Rhs) const
inline
588  {
589  return !(operator==(_Rhs));
590  }
bool operator==(const _ContextCallback &_Rhs) const
Definition: ppltasks.h:582
_ContextCallback& Concurrency::details::_ContextCallback::operator= ( const _ContextCallback _Src)
inline
555  {
556  if (this != &_Src)
557  {
558  _Reset();
559  _Assign(_Src._M_context._M_pContextCallback);
560  }
561  return *this;
562  }
_CRTIMP2 void __thiscall _Assign(void *_PContextCallback)
_CRTIMP2 void __thiscall _Reset()
_In_ size_t _Out_opt_ int _In_z_ unsigned char const * _Src
Definition: mbstring.h:1039
_ContextCallback& Concurrency::details::_ContextCallback::operator= ( _ContextCallback &&  _Src)
inline
565  {
566  if (this != &_Src)
567  {
568  _M_context._M_pContextCallback = _Src._M_context._M_pContextCallback;
569  _Src._M_context._M_pContextCallback = nullptr;
570  }
571  return *this;
572  }
union Concurrency::details::_ContextCallback::@100 _M_context
_In_ size_t _Out_opt_ int _In_z_ unsigned char const * _Src
Definition: mbstring.h:1039
bool Concurrency::details::_ContextCallback::operator== ( const _ContextCallback _Rhs) const
inline
583  {
584  return (_M_context._M_pContextCallback == _Rhs._M_context._M_pContextCallback);
585  }
union Concurrency::details::_ContextCallback::@100 _M_context

Member Data Documentation

size_t Concurrency::details::_ContextCallback::_M_captureMethod
union { ... } Concurrency::details::_ContextCallback::_M_context
void* Concurrency::details::_ContextCallback::_M_pContextCallback
const size_t Concurrency::details::_ContextCallback::_S_captureDeferred = 1
staticprivate

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