UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TGraphTask< TTask > Class Template Referencefinal

#include <TaskGraphInterfaces.h>

+ Inheritance diagram for TGraphTask< TTask >:

Classes

class  FConstructor
 

Static Public Member Functions

static FConstructor CreateTask (const FGraphEventArray *Prerequisites=nullptr, ENamedThreads::Type CurrentThreadIfKnown=ENamedThreads::AnyThread)
 
- Static Public Member Functions inherited from TConcurrentLinearObject< TGraphTask< TTask >, FTaskGraphBlockAllocationTag >
static voidoperator new (size_t Size)
 
static voidoperator new (size_t Size, void *Object)
 
static voidoperator new (size_t Size, std::align_val_t Align)
 
static voidoperator new[] (size_t Size)
 
static voidoperator new[] (size_t Size, std::align_val_t Align)
 
static UE_FORCEINLINE_HINT void operator delete (void *Ptr)
 
static UE_FORCEINLINE_HINT void operator delete[] (void *Ptr)
 
- Static Public Member Functions inherited from FBaseGraphTask
static FGraphEventRef CreateGraphEvent ()
 

Additional Inherited Members

- Public Member Functions inherited from FBaseGraphTask
 FBaseGraphTask (const FGraphEventArray *InPrerequisites)
 
void Init (const TCHAR *InDebugName, UE::Tasks::ETaskPriority InPriority, UE::Tasks::EExtendedTaskPriority InExtendedPriority, UE::Tasks::ETaskFlags InTaskFlags=UE::Tasks::ETaskFlags::None)
 
void Execute (TArray< FBaseGraphTask * > &NewTasks, ENamedThreads::Type CurrentThread, bool bDeleteOnCompletion)
 
FGraphEventRef GetCompletionEvent ()
 
void DontCompleteUntil (FGraphEventRef NestedTask)
 
bool IsComplete () const
 
bool IsTaskEvent () const
 
void Unlock (ENamedThreads::Type CurrentThreadIfKnown=ENamedThreads::AnyThread)
 
void DispatchSubsequents (ENamedThreads::Type CurrentThreadIfKnown=ENamedThreads::AnyThread)
 
void DispatchSubsequents (TArray< FBaseGraphTask * > &NewTasks, ENamedThreads::Type CurrentThreadIfKnown=ENamedThreads::AnyThread)
 
void SetDebugName (const TCHAR *InDebugName)
 
void Wait (ENamedThreads::Type CurrentThreadIfKnown=ENamedThreads::AnyThread)
 
ENamedThreads::Type GetThreadToExecuteOn () const
 
- Public Member Functions inherited from UE::Tasks::Private::FTaskBase
void AddRef ()
 
void Release ()
 
uint32 GetRefCount (std::memory_order MemoryOrder=std::memory_order_relaxed) const
 
bool IsAwaitable () const
 
bool IsNamedThreadTask () const
 
ETaskPriority GetPriority () const
 
EExtendedTaskPriority GetExtendedPriority () const
 
bool AddPrerequisites (FTaskBase &Prerequisite)
 
template<typename HigherLevelTaskType , decltype(std::declval< HigherLevelTaskType >().Pimpl) * = nullptr>
bool AddPrerequisites (const HigherLevelTaskType &Prerequisite)
 
template<typename HigherLevelTaskType , std::enable_if_t< std::is_same_v< HigherLevelTaskType, FGraphEventRef > > * = nullptr>
bool AddPrerequisites (const HigherLevelTaskType &Prerequisite)
 
template<typename PrerequisiteCollectionType , decltype(std::declval< PrerequisiteCollectionType >().begin()) * = nullptr>
void AddPrerequisites (const PrerequisiteCollectionType &InPrerequisites)
 
bool AddSubsequent (FTaskBase &Subsequent)
 
void SetPipe (FPipe &InPipe)
 
FPipeGetPipe () const
 
bool Trigger (uint64 TaskSize)
 
bool TryLaunch (uint64 TaskSize)
 
bool IsCompleted () const
 
CORE_API bool TryRetractAndExecute (FTimeout Timeout, uint32 RecursionDepth=0)
 
void ReleaseInternalReference ()
 
void AddNested (FTaskBase &Nested)
 
CORE_API bool Wait (FTimeout Timeout)
 
CORE_API void Wait ()
 
CORE_API void WaitWithNamedThreadsSupport ()
 
TaskTrace::FId GetTraceId () const
 
- Protected Member Functions inherited from UE::Tasks::Private::FTaskBase
 FTaskBase (uint32 InitRefCount, bool bUnlockPrerequisites=true)
 
void Init (const TCHAR *InDebugName, ETaskPriority InPriority, EExtendedTaskPriority InExtendedPriority, ETaskFlags Flags)
 
virtual ~FTaskBase ()
 
template<typename PrerequisiteCollectionType , decltype(std::declval< PrerequisiteCollectionType >().begin()) * = nullptr>
void AddPrerequisites (const PrerequisiteCollectionType &InPrerequisites, bool bLockPrerequisite)
 
bool TryExecuteTask ()
 
void Close ()
 
CORE_API void ClearPipe ()
 
void UnlockPrerequisites ()
 

Detailed Description

template<typename TTask>
class TGraphTask< TTask >

Templated graph task that is created to execute a specific function

Member Function Documentation

◆ CreateTask()

template<typename TTask >
static FConstructor TGraphTask< TTask >::CreateTask ( const FGraphEventArray Prerequisites = nullptr,
ENamedThreads::Type  CurrentThreadIfKnown = ENamedThreads::AnyThread 
)
inlinestatic

Factory to create a task and return the helper object to construct the embedded task and set it up for execution.

Parameters
Prerequisites;the list of FGraphEvents that must be completed prior to this task executing.
CurrentThreadIfKnown;provides the index of the thread we are running on. Can be ENamedThreads::AnyThread if the current thread is unknown.
Returns
a temporary helper class which can be used to complete the process.

The documentation for this class was generated from the following file: