STLdoc
STLdocumentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Public Types | Public Member Functions | Public Attributes | List of all members
Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection > Struct Template Reference

The task handle type used to create a 'continuation task'. More...

Inheritance diagram for Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >:
Concurrency::details::_PPLTaskHandle< details::_NormalizeVoidToUnitType< _ContinuationReturnType >::_Type, _ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >, details::_ContinuationTaskHandleBase > Concurrency::details::_ContinuationTaskHandleBase Concurrency::details::_TaskProcHandle Concurrency::details::_UnrealizedChore Concurrency::details::_Chore Concurrency::details::_AllocBase

Public Types

typedef details::_NormalizeVoidToUnitType< _ContinuationReturnType >::_Type _NormalizedContinuationReturnType
 

Public Member Functions

 _ContinuationTaskHandle (const typename details::_Task_ptr< _ReturnType >::_Type &_AncestorImpl, const typename details::_Task_ptr< _NormalizedContinuationReturnType >::_Type &_ContinuationImpl, const _Function &_Func, const task_continuation_context &_Context, details::_TaskInliningMode_t _InliningMode)
 
virtual ~_ContinuationTaskHandle ()
 
template<typename _Func , typename _Arg >
auto _LogWorkItemAndInvokeUserLambda (_Func &&_func, _Arg &&_value) const -> decltype(_func(std::forward< _Arg >(_value)))
 
void _Perform () const
 
void _SyncCancelAndPropagateException () const
 
void _Continue (std::false_type, details::_TypeSelectorNoAsync) const
 
void _Continue (std::false_type, details::_TypeSelectorAsyncOperationOrTask) const
 
void _Continue (std::true_type, details::_TypeSelectorNoAsync) const
 
void _Continue (std::true_type, details::_TypeSelectorAsyncOperationOrTask) const
 
- Public Member Functions inherited from Concurrency::details::_PPLTaskHandle< details::_NormalizeVoidToUnitType< _ContinuationReturnType >::_Type, _ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >, details::_ContinuationTaskHandleBase >
 _PPLTaskHandle (const typename _Task_ptr< details::_NormalizeVoidToUnitType< _ContinuationReturnType >::_Type >::_Type &_PTask)
 
virtual ~_PPLTaskHandle ()
 
virtual void invoke () const
 
_Task_ptr_base _GetTaskImplBase () const
 
- Public Member Functions inherited from Concurrency::details::_ContinuationTaskHandleBase
 _ContinuationTaskHandleBase ()
 
virtual ~_ContinuationTaskHandleBase ()
 
- Public Member Functions inherited from Concurrency::details::_TaskProcHandle
 _TaskProcHandle ()
 
virtual ~_TaskProcHandle ()
 
void operator() () const
 
- Public Member Functions inherited from Concurrency::details::_UnrealizedChore
 _UnrealizedChore ()
 
virtual ~_UnrealizedChore ()
 
void _Invoke ()
 
void _SetDetached (bool _FDetached)
 
Concurrency::details::_TaskCollectionBase_OwningCollection () const
 
void _SetRuntimeOwnsLifetime (bool fValue)
 
bool _GetRuntimeOwnsLifetime () const
 
void _PrepareSteal (ContextBase *_PContext)
 
- Public Member Functions inherited from Concurrency::details::_AllocBase
voidoperator new (size_t _Size)
 
void operator delete (void *_Ptr) throw ()
 
voidoperator new (size_t _Size, const std::nothrow_t &) throw ()
 
void operator delete (void *_Ptr, const std::nothrow_t &) throw ()
 
voidoperator new[] (size_t _Size)
 
void operator delete[] (void *_Ptr) throw ()
 
voidoperator new[] (size_t _Size, const std::nothrow_t &_No_throw) throw ()
 
void operator delete[] (void *_Ptr, const std::nothrow_t &_No_throw) throw ()
 
voidoperator new (size_t, void *_Location) throw ()
 
void operator delete (void *, void *) throw ()
 
void *__cdecl operator new[] (size_t, void *_Location) throw ()
 
void __cdecl operator delete[] (void *, void *) throw ()
 

Public Attributes

details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
 
_Function _M_function
 
- Public Attributes inherited from Concurrency::details::_PPLTaskHandle< details::_NormalizeVoidToUnitType< _ContinuationReturnType >::_Type, _ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >, details::_ContinuationTaskHandleBase >
_Task_ptr< details::_NormalizeVoidToUnitType< _ContinuationReturnType >::_Type >::_Type _M_pTask
 
- Public Attributes inherited from Concurrency::details::_ContinuationTaskHandleBase
_ContinuationTaskHandleBase_M_next
 
task_continuation_context _M_continuationContext
 
bool _M_isTaskBasedContinuation
 
_TaskInliningMode_t _M_inliningMode
 
- Public Attributes inherited from Concurrency::details::_Chore
TaskProc m_pFunction
 

Additional Inherited Members

- Static Public Member Functions inherited from Concurrency::details::_TaskProcHandle
static void __cdecl _RunChoreBridge (void *_Parameter)
 
- Static Public Member Functions inherited from Concurrency::details::_UnrealizedChore
template<typename _ChoreType , typename _Function >
static _ChoreType * _InternalAlloc (const _Function &_Func)
 
- Protected Member Functions inherited from Concurrency::details::_UnrealizedChore
_CRTIMP void _CheckTaskCollection ()
 
- Protected Member Functions inherited from Concurrency::details::_Chore
 _Chore (TaskProc _PFunction)
 
 _Chore ()
 
virtual ~_Chore ()
 
- Static Protected Member Functions inherited from Concurrency::details::_UnrealizedChore
template<typename _ChoreType >
static void __cdecl _InvokeBridge (void *_PContext)
 

Detailed Description

template<typename _ReturnType>
template<typename _InternalReturnType, typename _ContinuationReturnType, typename _Function, typename _IsTaskBased, typename _TypeSelection>
struct Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >

The task handle type used to create a 'continuation task'.

Member Typedef Documentation

template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
typedef details::_NormalizeVoidToUnitType<_ContinuationReturnType>::_Type Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_NormalizedContinuationReturnType

Constructor & Destructor Documentation

template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_ContinuationTaskHandle ( const typename details::_Task_ptr< _ReturnType >::_Type _AncestorImpl,
const typename details::_Task_ptr< _NormalizedContinuationReturnType >::_Type _ContinuationImpl,
const _Function &  _Func,
const task_continuation_context _Context,
details::_TaskInliningMode_t  _InliningMode 
)
inline
3758  _ContinuationTaskHandle<_InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection>, details::_ContinuationTaskHandleBase>
3759  ::_PPLTaskHandle(_ContinuationImpl)
3760  , _M_ancestorTaskImpl(_AncestorImpl)
3761  , _M_function(_Func)
3762  {
3763  this->_M_isTaskBasedContinuation = _IsTaskBased::value;
3764  this->_M_continuationContext = _Context;
3765  this->_M_continuationContext._Resolve(_AncestorImpl->_IsApartmentAware());
3766  this->_M_inliningMode = _InliningMode;
3767  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3751
void _Resolve(bool) const
Definition: ppltasks.h:766
bool _M_isTaskBasedContinuation
Definition: ppltasks.h:1397
_TaskInliningMode_t _M_inliningMode
Definition: ppltasks.h:1400
_In_ wctype_t _Type
Definition: ctype.h:205
_Function _M_function
Definition: ppltasks.h:3752
task_continuation_context _M_continuationContext
Definition: ppltasks.h:1396
template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
virtual Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::~_ContinuationTaskHandle ( )
inlinevirtual
3769 {}

Member Function Documentation

template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
void Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_Continue ( std::false_type  ,
details::_TypeSelectorNoAsync   
) const
inline
3805  {
3806  this->_M_pTask->_FinalizeAndRunContinuations(
3807  _LogWorkItemAndInvokeUserLambda(_Continuation_func_transformer<_InternalReturnType, _ContinuationReturnType>::_Perform(_M_function), _M_ancestorTaskImpl->_GetResult()));
3808  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3751
auto _LogWorkItemAndInvokeUserLambda(_Func &&_func, _Arg &&_value) const -> decltype(_func(std::forward< _Arg >(_value)))
Definition: ppltasks.h:3772
_Function _M_function
Definition: ppltasks.h:3752
template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
void Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_Continue ( std::false_type  ,
details::_TypeSelectorAsyncOperationOrTask   
) const
inline
3819  {
3820  typedef typename details::_FunctionTypeTraits<_Function, _InternalReturnType>::_FuncRetType _FuncOutputType;
3821 
3822  details::_Task_impl_base::_AsyncInit<_NormalizedContinuationReturnType, _ContinuationReturnType>(
3823  this->_M_pTask,
3824  _LogWorkItemAndInvokeUserLambda(_Continuation_func_transformer<_InternalReturnType, _FuncOutputType>::_Perform(_M_function), _M_ancestorTaskImpl->_GetResult())
3825  );
3826  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3751
auto _LogWorkItemAndInvokeUserLambda(_Func &&_func, _Arg &&_value) const -> decltype(_func(std::forward< _Arg >(_value)))
Definition: ppltasks.h:3772
_Function _M_function
Definition: ppltasks.h:3752
template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
void Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_Continue ( std::true_type  ,
details::_TypeSelectorNoAsync   
) const
inline
3886  {
3887  typedef task<_InternalReturnType> _FuncInputType;
3888  task<_InternalReturnType> _ResultTask;
3889  _ResultTask._SetImpl(std::move(_M_ancestorTaskImpl));
3890  this->_M_pTask->_FinalizeAndRunContinuations(
3891  _LogWorkItemAndInvokeUserLambda(_Continuation_func_transformer<_FuncInputType, _ContinuationReturnType>::_Perform(_M_function), std::move(_ResultTask)));
3892  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3751
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
auto _LogWorkItemAndInvokeUserLambda(_Func &&_func, _Arg &&_value) const -> decltype(_func(std::forward< _Arg >(_value)))
Definition: ppltasks.h:3772
_Function _M_function
Definition: ppltasks.h:3752
template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
void Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_Continue ( std::true_type  ,
details::_TypeSelectorAsyncOperationOrTask   
) const
inline
3904  {
3905  // The continuation takes a parameter of type task<_Input>, which is the same as the ancestor task.
3906  task<_InternalReturnType> _ResultTask;
3907  _ResultTask._SetImpl(std::move(_M_ancestorTaskImpl));
3908  details::_Task_impl_base::_AsyncInit<_NormalizedContinuationReturnType, _ContinuationReturnType>(this->_M_pTask,
3910  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3751
_OutIt move(_InIt _First, _InIt _Last, _OutIt _Dest)
Definition: xutility:2447
auto _LogWorkItemAndInvokeUserLambda(_Func &&_func, _Arg &&_value) const -> decltype(_func(std::forward< _Arg >(_value)))
Definition: ppltasks.h:3772
_Function _M_function
Definition: ppltasks.h:3752
template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
template<typename _Func , typename _Arg >
auto Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_LogWorkItemAndInvokeUserLambda ( _Func &&  _func,
_Arg &&  _value 
) const -> decltype(_func(std::forward<_Arg>(_value)))
inline
3773  {
3774  details::_TaskWorkItemRAIILogger _LogWorkItem(this->_M_pTask->_M_taskEventLogger);
3775  return _func(std::forward<_Arg>(_value));
3776  }
template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
void Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_Perform ( ) const
inline
3779  {
3780  _Continue(_IsTaskBased(), _TypeSelection());
3781  }
void _Continue(std::false_type, details::_TypeSelectorNoAsync) const
Definition: ppltasks.h:3804
template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
void Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_SyncCancelAndPropagateException ( ) const
inline
3784  {
3785  if (_M_ancestorTaskImpl->_HasUserException())
3786  {
3787  // If the ancestor encountered an exception, transfer the exception to the continuation
3788  // This traverses down the tree to propagate the exception.
3789  this->_M_pTask->_CancelWithExceptionHolder(_M_ancestorTaskImpl->_GetExceptionHolder(), true);
3790  }
3791  else
3792  {
3793  // If the ancestor was canceled, then your own execution should be canceled.
3794  // This traverses down the tree to cancel it.
3795  this->_M_pTask->_Cancel(true);
3796  }
3797  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3751

Member Data Documentation

template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
details::_Task_ptr<_ReturnType>::_Type Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_M_ancestorTaskImpl
template<typename _ReturnType>
template<typename _InternalReturnType , typename _ContinuationReturnType , typename _Function , typename _IsTaskBased , typename _TypeSelection >
_Function Concurrency::task< _ReturnType >::_ContinuationTaskHandle< _InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection >::_M_function

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