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

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 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
 

Additional Inherited Members

- Static Public Member Functions inherited from Concurrency::details::_TaskProcHandle
static void __cdecl _RunChoreBridge (void *_Parameter)
 

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
3559  _ContinuationTaskHandle<_InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection>, details::_ContinuationTaskHandleBase>
3560  ::_PPLTaskHandle(_ContinuationImpl)
3561  , _M_ancestorTaskImpl(_AncestorImpl)
3562  , _M_function(_Func)
3563  {
3564  this->_M_isTaskBasedContinuation = _IsTaskBased::value;
3566  this->_M_continuationContext._Resolve(_AncestorImpl->_IsApartmentAware());
3567  this->_M_inliningMode = _InliningMode;
3568  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3552
void _Resolve(bool _CaptureCurrent)
Definition: ppltasks.h:528
bool _M_isTaskBasedContinuation
Definition: ppltasks.h:1294
_TaskInliningMode_t _M_inliningMode
Definition: ppltasks.h:1297
_In_ wctype_t _Type
Definition: corecrt_wctype.h:111
_Function _M_function
Definition: ppltasks.h:3553
_Check_return_ _In_z_ wchar_t const _Inout_opt_ _Deref_prepost_opt_z_ wchar_t ** _Context
Definition: corecrt_wstring.h:228
task_continuation_context _M_continuationContext
Definition: ppltasks.h:1293
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
3570 {}

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
3606  {
3607  this->_M_pTask->_FinalizeAndRunContinuations(
3608  _LogWorkItemAndInvokeUserLambda(_Continuation_func_transformer<_InternalReturnType, _ContinuationReturnType>::_Perform(_M_function), _M_ancestorTaskImpl->_GetResult()));
3609  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3552
auto _LogWorkItemAndInvokeUserLambda(_Func &&_func, _Arg &&_value) const -> decltype(_func(std::forward< _Arg >(_value)))
Definition: ppltasks.h:3573
_Function _M_function
Definition: ppltasks.h:3553
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
3620  {
3621  typedef typename details::_FunctionTypeTraits<_Function, _InternalReturnType>::_FuncRetType _FuncOutputType;
3622 
3623  details::_Task_impl_base::_AsyncInit<_NormalizedContinuationReturnType, _ContinuationReturnType>(
3624  this->_M_pTask,
3625  _LogWorkItemAndInvokeUserLambda(_Continuation_func_transformer<_InternalReturnType, _FuncOutputType>::_Perform(_M_function), _M_ancestorTaskImpl->_GetResult())
3626  );
3627  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3552
auto _LogWorkItemAndInvokeUserLambda(_Func &&_func, _Arg &&_value) const -> decltype(_func(std::forward< _Arg >(_value)))
Definition: ppltasks.h:3573
_Function _M_function
Definition: ppltasks.h:3553
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
3687  {
3688  typedef task<_InternalReturnType> _FuncInputType;
3689  task<_InternalReturnType> _ResultTask;
3690  _ResultTask._SetImpl(std::move(_M_ancestorTaskImpl));
3691  this->_M_pTask->_FinalizeAndRunContinuations(
3692  _LogWorkItemAndInvokeUserLambda(_Continuation_func_transformer<_FuncInputType, _ContinuationReturnType>::_Perform(_M_function), std::move(_ResultTask)));
3693  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3552
auto _LogWorkItemAndInvokeUserLambda(_Func &&_func, _Arg &&_value) const -> decltype(_func(std::forward< _Arg >(_value)))
Definition: ppltasks.h:3573
_Function _M_function
Definition: ppltasks.h:3553
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
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
3705  {
3706  // The continuation takes a parameter of type task<_Input>, which is the same as the ancestor task.
3707  task<_InternalReturnType> _ResultTask;
3708  _ResultTask._SetImpl(std::move(_M_ancestorTaskImpl));
3709  details::_Task_impl_base::_AsyncInit<_NormalizedContinuationReturnType, _ContinuationReturnType>(this->_M_pTask,
3711  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3552
auto _LogWorkItemAndInvokeUserLambda(_Func &&_func, _Arg &&_value) const -> decltype(_func(std::forward< _Arg >(_value)))
Definition: ppltasks.h:3573
_Function _M_function
Definition: ppltasks.h:3553
constexpr remove_reference< _Ty >::type && move(_Ty &&_Arg) _NOEXCEPT
Definition: type_traits:1349
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
3574  {
3575  details::_TaskWorkItemRAIILogger _LogWorkItem(this->_M_pTask->_M_taskEventLogger);
3576  return _func(std::forward<_Arg>(_value));
3577  }
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
3580  {
3581  _Continue(_IsTaskBased(), _TypeSelection());
3582  }
void _Continue(std::false_type, details::_TypeSelectorNoAsync) const
Definition: ppltasks.h:3605
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
3585  {
3586  if (_M_ancestorTaskImpl->_HasUserException())
3587  {
3588  // If the ancestor encountered an exception, transfer the exception to the continuation
3589  // This traverses down the tree to propagate the exception.
3590  this->_M_pTask->_CancelWithExceptionHolder(_M_ancestorTaskImpl->_GetExceptionHolder(), true);
3591  }
3592  else
3593  {
3594  // If the ancestor was canceled, then your own execution should be canceled.
3595  // This traverses down the tree to cancel it.
3596  this->_M_pTask->_Cancel(true);
3597  }
3598  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3552

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: