UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FBaseGraphTask Class Reference

#include <TaskGraphInterfaces.h>

+ Inheritance diagram for FBaseGraphTask:

Public Member Functions

 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
 

Static Public Member Functions

static FGraphEventRef CreateGraphEvent ()
 

Additional Inherited Members

- 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 ()
 
virtual void ExecuteTask ()=0
 
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

Base class for all graph tasks, used for both TGraphTask and simple graph events. This is a wrapper around the Tasks::Private::FTaskBase functionality

Constructor & Destructor Documentation

◆ FBaseGraphTask()

FBaseGraphTask::FBaseGraphTask ( const FGraphEventArray InPrerequisites)
inlineexplicit

Member Function Documentation

◆ CreateGraphEvent()

FGraphEventRef FBaseGraphTask::CreateGraphEvent ( )
inlinestatic

Create a simple task event that can be used as a prerequisite for other tasks, and then manually triggered with DispatchSubsequents

◆ DispatchSubsequents() [1/2]

void FBaseGraphTask::DispatchSubsequents ( ENamedThreads::Type  CurrentThreadIfKnown = ENamedThreads::AnyThread)
inline

Backward compatibility wrapper for Unlock

◆ DispatchSubsequents() [2/2]

void FBaseGraphTask::DispatchSubsequents ( TArray< FBaseGraphTask * > &  NewTasks,
ENamedThreads::Type  CurrentThreadIfKnown = ENamedThreads::AnyThread 
)
inline

◆ DontCompleteUntil()

void FBaseGraphTask::DontCompleteUntil ( FGraphEventRef  NestedTask)
inline

Call on a currently active task to add a nested task, which will delay any subsequent tasks until the nested task completes. AddPrerequisites should be used instead if the task has not yet been launched.

◆ Execute()

void FBaseGraphTask::Execute ( TArray< FBaseGraphTask * > &  NewTasks,
ENamedThreads::Type  CurrentThread,
bool  bDeleteOnCompletion 
)
inline

◆ GetCompletionEvent()

FGraphEventRef FBaseGraphTask::GetCompletionEvent ( )
inline

Returns a reference to this task that can be used as a prerequisite for new tasks or passed to DontCompleteUntil

◆ GetThreadToExecuteOn()

ENamedThreads::Type FBaseGraphTask::GetThreadToExecuteOn ( ) const
inline

Returns the old-style named thread this task will be executed on

◆ Init()

void FBaseGraphTask::Init ( const TCHAR InDebugName,
UE::Tasks::ETaskPriority  InPriority,
UE::Tasks::EExtendedTaskPriority  InExtendedPriority,
UE::Tasks::ETaskFlags  InTaskFlags = UE::Tasks::ETaskFlags::None 
)
inline

◆ IsComplete()

bool FBaseGraphTask::IsComplete ( ) const
inline

Return true if this task has finished executing, this wrapper exists for backward compatibility

◆ IsTaskEvent()

bool FBaseGraphTask::IsTaskEvent ( ) const
inline

Returns true if this is a simple task event, which cannot execute code and must be manually dispatched

◆ SetDebugName()

void FBaseGraphTask::SetDebugName ( const TCHAR InDebugName)
inline

◆ Unlock()

void FBaseGraphTask::Unlock ( ENamedThreads::Type  CurrentThreadIfKnown = ENamedThreads::AnyThread)
inline

Unlocks a task that was returned from ConstructAndHold or CreateGraphEvent, which may execute immediately if prerequisites are already completed. This can only be safely called exactly once and the caller is responsible for tracking that.

◆ Wait()

void FBaseGraphTask::Wait ( ENamedThreads::Type  CurrentThreadIfKnown = ENamedThreads::AnyThread)
inline

Blocks the current thread and waits for the completion of this task


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