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
510  {
511  _Reset();
512  }
_CRTIMP2 void __thiscall _Reset()
Concurrency::details::_ContextCallback::_ContextCallback ( bool  _DeferCapture = false)
inline
515  {
516  if (_DeferCapture)
517  {
518  _M_context._M_captureMethod = _S_captureDeferred;
519  }
520  else
521  {
522  _M_context._M_pContextCallback = nullptr;
523  }
524  }
static const size_t _S_captureDeferred
Definition: ppltasks.h:614
union Concurrency::details::_ContextCallback::@91 _M_context
Concurrency::details::_ContextCallback::_ContextCallback ( const _ContextCallback _Src)
inline
543  {
544  _Assign(_Src._M_context._M_pContextCallback);
545  }
_CRTIMP2 void __thiscall _Assign(void *_PContextCallback)
Concurrency::details::_ContextCallback::_ContextCallback ( _ContextCallback &&  _Src)
inline
548  {
549  _M_context._M_pContextCallback = _Src._M_context._M_pContextCallback;
550  _Src._M_context._M_pContextCallback = nullptr;
551  }
union Concurrency::details::_ContextCallback::@91 _M_context

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
594  {
595  _CallInContext(_Func, false);
596  }
_CRTIMP2 void __thiscall _CallInContext(_CallbackFunction _Func, bool _IgnoreDisconnect) const
_CRTIMP2 void __thiscall Concurrency::details::_ContextCallback::_Capture ( )
private
static _ContextCallback Concurrency::details::_ContextCallback::_CaptureCurrent ( )
inlinestatic
503  {
504  _ContextCallback _Context;
505  _Context._Capture();
506  return _Context;
507  }
_ContextCallback(bool _DeferCapture=false)
Definition: ppltasks.h:514
bool Concurrency::details::_ContextCallback::_HasCapturedContext ( ) const
inline
574  {
575  _ASSERTE(_M_context._M_captureMethod != _S_captureDeferred);
576  return (_M_context._M_pContextCallback != nullptr);
577  }
static const size_t _S_captureDeferred
Definition: ppltasks.h:614
union Concurrency::details::_ContextCallback::@91 _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
528  {
529  if(_M_context._M_captureMethod == _S_captureDeferred)
530  {
531  _M_context._M_pContextCallback = nullptr;
532 
534  {
535  _Capture();
536  }
537  }
538  }
static const size_t _S_captureDeferred
Definition: ppltasks.h:614
union Concurrency::details::_ContextCallback::@91 _M_context
static _CRTIMP2 bool __cdecl _IsCurrentOriginSTA()
static _ContextCallback _CaptureCurrent()
Definition: ppltasks.h:502
_CRTIMP2 void __thiscall _Capture()
bool Concurrency::details::_ContextCallback::operator!= ( const _ContextCallback _Rhs) const
inline
587  {
588  return !(operator==(_Rhs));
589  }
bool operator==(const _ContextCallback &_Rhs) const
Definition: ppltasks.h:581
_ContextCallback& Concurrency::details::_ContextCallback::operator= ( const _ContextCallback _Src)
inline
554  {
555  if (this != &_Src)
556  {
557  _Reset();
558  _Assign(_Src._M_context._M_pContextCallback);
559  }
560  return *this;
561  }
_CRTIMP2 void __thiscall _Assign(void *_PContextCallback)
_CRTIMP2 void __thiscall _Reset()
_ContextCallback& Concurrency::details::_ContextCallback::operator= ( _ContextCallback &&  _Src)
inline
564  {
565  if (this != &_Src)
566  {
567  _M_context._M_pContextCallback = _Src._M_context._M_pContextCallback;
568  _Src._M_context._M_pContextCallback = nullptr;
569  }
570  return *this;
571  }
union Concurrency::details::_ContextCallback::@91 _M_context
bool Concurrency::details::_ContextCallback::operator== ( const _ContextCallback _Rhs) const
inline
582  {
583  return (_M_context._M_pContextCallback == _Rhs._M_context._M_pContextCallback);
584  }
union Concurrency::details::_ContextCallback::@91 _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: