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
3557  : details::_PPLTaskHandle<typename details::_NormalizeVoidToUnitType<_ContinuationReturnType>::_Type,
3558  _ContinuationTaskHandle<_InternalReturnType, _ContinuationReturnType, _Function, _IsTaskBased, _TypeSelection>, details::_ContinuationTaskHandleBase>
3559  ::_PPLTaskHandle(_ContinuationImpl)
3560  , _M_ancestorTaskImpl(_AncestorImpl)
3561  , _M_function(_Func)
3562  {
3563  this->_M_isTaskBasedContinuation = _IsTaskBased::value;
3564  this->_M_continuationContext = _Context;
3565  this->_M_continuationContext._Resolve(_AncestorImpl->_IsApartmentAware());
3566  this->_M_inliningMode = _InliningMode;
3567  }
details::_Task_ptr< _ReturnType >::_Type _M_ancestorTaskImpl
Definition: ppltasks.h:3551
void _Resolve(bool _CaptureCurrent)
Definition: ppltasks.h:527
bool _M_isTaskBasedContinuation
Definition: ppltasks.h:1293
_TaskInliningMode_t _M_inliningMode
Definition: ppltasks.h:1296
_Function _M_function
Definition: ppltasks.h:3552
task_continuation_context _M_continuationContext
Definition: ppltasks.h:1292
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
3569 {}

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

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: