Navigation
Unreal Engine C++ API Reference > Runtime > Core > Tasks
Inheritance Hierarchy
- FInheritedContextBase
- FTaskBase
- FTaskEventBase
- TExecutableTaskBase< TaskBodyType, typename TEnableIf< std::is_same_v< TInvokeResult_T< TaskBodyType >, void > >::Type >
- TTaskWithResult
- TExecutableTaskBase
- TExecutableTask
References
Module | Core |
Header | /Engine/Source/Runtime/Core/Public/Tasks/TaskPrivate.h |
Include | #include "Tasks/TaskPrivate.h" |
Syntax
class FTaskBase : private UE::FInheritedContextBase
Remarks
An abstract base class for task implementation. Implements internal logic of task prerequisites, nested tasks and deep task retraction. Implements intrusive ref-counting and so can be used with TRefCountPtr. It doesn't store task body, instead it expects a derived class to provide a task body as a parameter to `TryExecute_ method.
Constructors
Type | Name | Description | |
---|---|---|---|
![]() |
FTaskBase
(
uint32 InitRefCount |
Destructors
Type | Name | Description | |
---|---|---|---|
![]() ![]() |
~FTaskBase () |
Functions
Type | Name | Description | |
---|---|---|---|
![]() |
void | Adds a nested task that must be completed before the parent (this) is completed | |
![]() |
void | AddPrerequisites
(
const PrerequisiteCollectionType& InPrerequisites |
The task will be executed only when all prerequisites are completed. |
![]() |
bool | AddPrerequisites
(
const HigherLevelTaskType& Prerequisite |
The task will be executed only when all prerequisites are completed. |
![]() |
bool | AddPrerequisites
(
FTaskBase& Prerequisite |
The task will be executed only when all prerequisites are completed. |
![]() |
void | AddRef () |
Ref-count |
![]() |
bool | AddSubsequent
(
FTaskBase& Subsequent |
The task unlocks all its subsequents on completion. |
![]() |
bool | Waits until the task is completed or waiting timed out, while executing other tasks | |
![]() |
bool | BusyWait
(
ConditionType&& Condition |
Waits until the task is completed or the condition returns true, while executing other tasks |
![]() |
void | ClearPipe () |
|
![]() |
void | Close () |
Closes task by unlocking its subsequents and flagging it as completed |
![]() |
void | ExecuteTask () |
|
![]() ![]() |
EExtendedTaskPriority | ||
![]() ![]() |
FPipe * | GetPipe () |
|
![]() ![]() |
ETaskPriority | GetPriority () |
|
![]() ![]() |
uint32 | GetRefCount
(
std::memory_order MemoryOrder |
|
![]() ![]() |
TaskTrace::FId | GetTraceId () |
|
![]() |
void | Init
(
const TCHAR* InDebugName, |
|
![]() ![]() |
bool | IsAwaitable () |
Returns true if it's valid to wait for the task completion. |
![]() ![]() |
bool | IsCompleted () |
|
![]() |
void | Release () |
|
![]() |
void | Releases internal reference and maintains low-level task state. | |
![]() |
void | A piped task is executed after the previous task from this pipe is completed. | |
![]() |
bool | Tries to get execution permission and if successful, executes given task body and completes the task if there're no pending nested tasks. | |
![]() |
bool | TryLaunch
(
uint64 TaskSize |
Tries to schedule task execution. |
![]() |
bool | TryRetractAndExecute
(
FTimeout Timeout, |
Tries to pull out the task from the system and execute it. |
![]() |
bool | Waits for task's completion, with optional timeout. |
Constants
Name | Description |
---|---|
ExecutionFlag | ExecutionFlag_ is set at the beginning of execution as the most significant bit of NumLocks_ and indicates a switch of `NumLocks_ from "execution prerequisites" (a number of uncompleted prerequisites that block task execution) to "completion prerequisites" (a number of nested uncompleted tasks that block task completion) |
NumInitialLocks | The number of times that the task should be unlocked before it can be scheduled or completed initial count is 1 for launching the task (it can't be scheduled before it's launched) reaches 0 the task is scheduled for execution. |