STLdoc
STLdocumentation
|
The base implementation of a first-class task. This class contains all the non-type specific implementation details of the task. More...
#include <ppltasks.h>
Public Types | |
enum | _TaskInternalState { _Created, _Started, _PendingCancel, _Completed, _Canceled } |
typedef _ContinuationTaskHandleBase * | _ContinuationList |
Public Member Functions | |
_Task_impl_base (_CancellationTokenState *_PTokenState, scheduler_ptr _Scheduler_arg) | |
virtual | ~_Task_impl_base () |
task_status | _Wait () |
virtual bool | _CancelAndRunContinuations (bool _SynchronousCancel, bool _UserException, bool _PropagatedFromAncestor, const std::shared_ptr< _ExceptionHolder > &_ExHolder)=0 |
Requests cancellation on the task and schedules continuations if the task can be transitioned to a terminal state. More... | |
bool | _Cancel (bool _SynchronousCancel) |
bool | _CancelWithExceptionHolder (const std::shared_ptr< _ExceptionHolder > &_ExHolder, bool _PropagatedFromAncestor) |
bool | _CancelWithException (const std::exception_ptr &_Exception) |
void | _RegisterCancellation (std::weak_ptr< _Task_impl_base > _WeakPtr) |
void | _DeregisterCancellation () |
bool | _IsCreated () |
bool | _IsStarted () |
bool | _IsPendingCancel () |
bool | _IsCompleted () |
bool | _IsCanceled () |
bool | _HasUserException () |
const std::shared_ptr< _ExceptionHolder > & | _GetExceptionHolder () |
bool | _IsApartmentAware () |
void | _SetAsync (bool _Async=true) |
_TaskCreationCallstack | _GetTaskCreationCallstack () |
void | _SetTaskCreationCallstack (const _TaskCreationCallstack &_Callstack) |
void | _ScheduleTask (_UnrealizedChore_t *_PTaskHandle, _TaskInliningMode_t _InliningMode) |
Helper function to schedule the task on the Task Collection. More... | |
void | _RunContinuation (_ContinuationTaskHandleBase *_PTaskHandle) |
Function executes a continuation. This function is recorded by a parent task implementation when a continuation is created in order to execute later. More... | |
void | _ScheduleContinuationTask (_ContinuationTaskHandleBase *_PTaskHandle) |
void | _ScheduleContinuation (_ContinuationTaskHandleBase *_PTaskHandle) |
Schedule the actual continuation. This will either schedule the function on the continuation task's implementation if the task has completed or append it to a list of functions to execute when the task actually does complete. More... | |
void | _RunTaskContinuations () |
scheduler_ptr | _GetScheduler () const |
Static Public Member Functions | |
template<typename _ReturnType , typename _InternalReturnType > | |
static void | _AsyncInit (const typename _Task_ptr< _ReturnType >::_Type &_OuterTask, const task< _InternalReturnType > &_UnwrappedTask) |
Private Member Functions | |
_Task_impl_base (const _Task_impl_base &) | |
_Task_impl_base const & | operator= (_Task_impl_base const &) |
The base implementation of a first-class task. This class contains all the non-type specific implementation details of the task.
Enumerator | |
---|---|
_Created | |
_Started | |
_PendingCancel | |
_Completed | |
_Canceled |
|
inline |
|
inlinevirtual |
|
private |
|
inlinestatic |
|
pure virtual |
Requests cancellation on the task and schedules continuations if the task can be transitioned to a terminal state.
_SynchronousCancel | Set to true if the cancel takes place as a result of the task body encountering an exception, or because an ancestor or task_completion_event the task was registered with were canceled with an exception. A synchronous cancel is one that assures the task could not be running on a different thread at the time the cancellation is in progress. An asynchronous cancel is one where the thread performing the cancel has no control over the thread that could be executing the task, that is the task could execute concurrently while the cancellation is in progress. |
_UserException | Whether an exception other than the internal runtime cancellation exceptions caused this cancellation. |
_PropagatedFromAncestor | Whether this exception came from an ancestor task or a task_completion_event as opposed to an exception that was encountered by the task itself. Only valid when _UserException is set to true. |
_ExHolder | The exception holder that represents the exception. Only valid when _UserException is set to true. |
Implemented in Concurrency::details::_Task_impl< _ReturnType >.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Function executes a continuation. This function is recorded by a parent task implementation when a continuation is created in order to execute later.
_PTaskHandle | The continuation task chore handle that need to be executed. |
|
inline |
|
inline |
Schedule the actual continuation. This will either schedule the function on the continuation task's implementation if the task has completed or append it to a list of functions to execute when the task actually does complete.
_FuncInputType | The input type of the task. |
_FuncOutputType | The output type of the task. |
|
inline |
|
inline |
Helper function to schedule the task on the Task Collection.
_PTaskHandle | The task chore handle that need to be executed. |
_InliningMode | The inlining scheduling policy for current _PTaskHandle. |
|
inline |
|
inline |
|
private |
_ContinuationList Concurrency::details::_Task_impl_base::_M_Continuations |
::Concurrency::extensibility::critical_section_t Concurrency::details::_Task_impl_base::_M_ContinuationsCritSec |
std::shared_ptr<_ExceptionHolder> Concurrency::details::_Task_impl_base::_M_exceptionHolder |
bool Concurrency::details::_Task_impl_base::_M_fFromAsync |
bool Concurrency::details::_Task_impl_base::_M_fUnwrappedTask |
_CancellationTokenRegistration* Concurrency::details::_Task_impl_base::_M_pRegistration |
_TaskCreationCallstack Concurrency::details::_Task_impl_base::_M_pTaskCreationCallstack |
_CancellationTokenState* Concurrency::details::_Task_impl_base::_M_pTokenState |
::Concurrency::details::_TaskCollection_t Concurrency::details::_Task_impl_base::_M_TaskCollection |
_TaskEventLogger Concurrency::details::_Task_impl_base::_M_taskEventLogger |
volatile _TaskInternalState Concurrency::details::_Task_impl_base::_M_TaskState |