Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Async
Inheritance Hierarchy
- TConcurrentLinearObject
- FBaseGraphTask
- TGraphTask
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Async/TaskGraphInterfaces.h |
| Include | #include "Async/TaskGraphInterfaces.h" |
Syntax
template<typename TTask>
class TGraphTask :
public TConcurrentLinearObject< TGraphTask< TTask >, FTaskGraphBlockAllocationTag > ,
public FBaseGraphTask
Remarks
The user defined task type can take arguments to a constructor. These arguments (unfortunately) must not be references. The API required of TTask:
class FGenericTask { TSomeType SomeArgument; public: FGenericTask(TSomeType InSomeArgument) // CAUTION!: Must not use references in the constructor args; use pointers instead if you need by reference : SomeArgument(InSomeArgument) { / Usually the constructor doesn't do anything except save the arguments for use in DoWork or GetDesiredThread. } ~FGenericTask() { / you will be destroyed immediately after you execute. Might as well do cleanup in DoWork, but you could also use a destructor. } FORCEINLINE TStatId GetStatId() const { RETURN_QUICK_DECLARE_CYCLE_STAT(FGenericTask, STATGROUP_TaskGraphTasks); }
[static] ENamedThreads::Type GetDesiredThread() { return ENamedThreads::[named thread or AnyThread]; } void DoTask(ENamedThreads::Type CurrentThread, const FGraphEventRef& MyCompletionGraphEvent) { / The arguments are useful for setting up other tasks. / Do work here, probably using SomeArgument. MyCompletionGraphEvent->DontCompleteUntil(TGraphTask
Constructors
No constructors are accessible with public or protected access.
Destructors
No destructors are accessible with public or protected access.
Functions
| Type | Name | Description | |
|---|---|---|---|
| FConstructor | CreateTask
(
const FGraphEventArray* Prerequisites, |
Factory to create a task and return the helper object to construct the embedded task and set it up for execution. | |
| FGraphEventRef | |||
| void | Unlock
(
ENamedThreads::Type CurrentThreadIfKnown |
Classes
| Type | Name | Description | |
|---|---|---|---|
| FConstructor | This is a helper class returned from the factory. |