UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Tick::FWorkQueueTickFunction Struct Reference

#include <TaskSyncManager.h>

+ Inheritance diagram for UE::Tick::FWorkQueueTickFunction:

Public Member Functions

ENGINE_API FWorkQueueTickFunction ()
 
virtual ENGINE_API ~FWorkQueueTickFunction ()
 
bool IsWorkExecuting () const
 
bool HasQueuedWork () const
 
bool IsQueueOpen () const
 
ENGINE_API void SetQueueOpen (bool bShouldBeOpen)
 
ENGINE_API bool AddWork (FWorkFunction &&Work)
 
ENGINE_API void ClearWork ()
 
ENGINE_API void ExecuteWork ()
 
ENGINE_API void SetDebugName (FName InDebugName, const FString &InDetailString=FString())
 
ENGINE_API void SetClearAfterExecute (bool bShouldClear)
 
ENGINE_API void SetOpenAfterExecute (bool bShouldOpen)
 
- Public Member Functions inherited from FTickFunction
 UPROPERTY (EditDefaultsOnly, Category="Tick", meta=(DisplayName="Tick Interval (secs)")) float TickInterval
 
ENGINE_API FTickFunction ()
 
virtual ENGINE_API ~FTickFunction ()
 
ENGINE_API void RegisterTickFunction (class ULevel *Level)
 
ENGINE_API void UnRegisterTickFunction ()
 
bool IsTickFunctionRegistered () const
 
ENGINE_API void SetTickFunctionEnable (bool bInEnabled)
 
bool IsTickFunctionEnabled () const
 
ENGINE_API void UpdateTickIntervalAndCoolDown (float NewTickInterval)
 
ENGINE_API bool IsCompletionHandleValid () const
 
ENGINE_API FGraphEventRef GetCompletionHandle () const
 
virtual ENGINE_API bool CanDispatchManually () const
 
virtual ENGINE_API bool DispatchManually ()
 
TEnumAsByte< enum ETickingGroupGetActualTickGroup () const
 
TEnumAsByte< enum ETickingGroupGetActualEndTickGroup () const
 
ENGINE_API void AddPrerequisite (UObject *TargetObject, struct FTickFunction &TargetTickFunction)
 
ENGINE_API void RemovePrerequisite (UObject *TargetObject, struct FTickFunction &TargetTickFunction)
 
ENGINE_API void SetPriorityIncludingPrerequisites (bool bInHighPriority)
 
TArray< struct FTickPrerequisite > & GetPrerequisites ()
 
const TArray< struct FTickPrerequisite > & GetPrerequisites () const
 
float GetLastTickGameTime () const
 
ENGINE_API void ExecuteNestedTick (float DeltaTime, ELevelTick TickType, ENamedThreads::Type CurrentThread, const FGraphEventRef &MyCompletionGraphEvent)
 
ENGINE_API float CalculateDeltaTime (float DeltaTime, const class UWorld *TickingWorld)
 
ENGINE_API void LogTickFunction (ENamedThreads::Type CurrentThread, bool bLogPrerequisites, int32 Indent=0)
 
ENGINE_API void ShowPrerequistes (int32 Indent=1)
 
ENGINE_API void ClearTaskInformation ()
 
virtual void virtual FString return TEXT ("DiagnosticMessage() not implemented")
 
virtual void ForEachNestedTick (TFunctionRef< void(FTickFunction &)> InFunc) const
 
FTickFunctionoperator= (const FTickFunction &)=delete
 

Protected Member Functions

ENGINE_API void ExecuteTick (float DeltaTime, ELevelTick TickType, ENamedThreads::Type CurrentThread, const FGraphEventRef &MyCompletionGraphEvent) override
 
ENGINE_API FString DiagnosticMessage () override
 
ENGINE_API FName DiagnosticContext (bool bDetailed) override
 

Protected Attributes

bool bSetAsOpen
 
bool bClearAfterExecute
 
bool bOpenAfterExecute
 
int32 WorkExecutionIndex
 
FName DebugName
 
FString DebugDetailString
 
TArray< FWorkFunctionQueuedWork
 

Additional Inherited Members

- Public Attributes inherited from FTickFunction
TEnumAsByte< enum ETickingGroupTickGroup
 
TEnumAsByte< enum ETickingGroupEndTickGroup
 
uint8 bTickEvenWhenPaused:1
 
uint8 bCanEverTick:1
 
uint8 bStartWithTickEnabled:1
 
uint8 bAllowTickOnDedicatedServer:1
 
uint8 bAllowTickBatching:1
 
uint8 bHighPriority:1
 
uint8 bRunOnAnyThread:1
 
uint8 bRunTransactionally:1
 
uint8 bDispatchManually: 1
 

Detailed Description

A Tick function that can be used to execute a set of arbitrary work. This can be used as a normal tick function or passed to the work request functions. This is NOT threadsafe on it's own, it needs to be protected by something like the locks in SendQueuedWork to use from multiple threads.

Constructor & Destructor Documentation

◆ FWorkQueueTickFunction()

FWorkQueueTickFunction::FWorkQueueTickFunction ( )

◆ ~FWorkQueueTickFunction()

FWorkQueueTickFunction::~FWorkQueueTickFunction ( )
virtual

Member Function Documentation

◆ AddWork()

bool FWorkQueueTickFunction::AddWork ( FWorkFunction &&  Work)

Try to add a new function to the queue

◆ ClearWork()

void FWorkQueueTickFunction::ClearWork ( )

Clear the queue, not allowed if execution has started

◆ DiagnosticContext()

FName FWorkQueueTickFunction::DiagnosticContext ( bool  bDetailed)
overrideprotectedvirtual

Function to give a 'context' for this tick, used for grouped active tick reporting

Reimplemented from FTickFunction.

◆ DiagnosticMessage()

FString FWorkQueueTickFunction::DiagnosticMessage ( )
overrideprotectedvirtual

Abstract function to describe this tick. Used to print messages about illegal cycles in the dependency graph

Reimplemented from FTickFunction.

◆ ExecuteTick()

void FWorkQueueTickFunction::ExecuteTick ( float  DeltaTime,
ELevelTick  TickType,
ENamedThreads::Type  CurrentThread,
const FGraphEventRef MyCompletionGraphEvent 
)
overrideprotectedvirtual

Abstract function actually execute the tick. Batched tick managers should use ExecuteNestedTick

Parameters
DeltaTime- frame time to advance, in seconds
TickType- kind of tick for this frame
CurrentThread- thread we are executing on, useful to pass along as new tasks are created
MyCompletionGraphEvent- completion event for this task. Useful for holding the completetion of this task until certain child tasks are complete.

Reimplemented from FTickFunction.

◆ ExecuteWork()

void FWorkQueueTickFunction::ExecuteWork ( )

Actually execute the work, also called by execute tick if this scheduled as a normal tick

◆ HasQueuedWork()

bool UE::Tick::FWorkQueueTickFunction::HasQueuedWork ( ) const
inline

Return true if any work has been queued

◆ IsQueueOpen()

bool UE::Tick::FWorkQueueTickFunction::IsQueueOpen ( ) const
inline

Return true if work can be added to the queue

◆ IsWorkExecuting()

bool UE::Tick::FWorkQueueTickFunction::IsWorkExecuting ( ) const
inline

Return true if this is currently executing, if so no work can be added to the queue

◆ SetClearAfterExecute()

void FWorkQueueTickFunction::SetClearAfterExecute ( bool  bShouldClear)

Sets if it should clear the queue after every execution (default behavior)

◆ SetDebugName()

void FWorkQueueTickFunction::SetDebugName ( FName  InDebugName,
const FString &  InDetailString = FString() 
)

Sets the debug name used by DiagnosticContext

◆ SetOpenAfterExecute()

void FWorkQueueTickFunction::SetOpenAfterExecute ( bool  bShouldOpen)

Sets if it should reopen a closed queue after every execution (default behavior)

◆ SetQueueOpen()

void FWorkQueueTickFunction::SetQueueOpen ( bool  bShouldBeOpen)

Explicitly close or open the queue, can be used to finalize before execution

Member Data Documentation

◆ bClearAfterExecute

bool UE::Tick::FWorkQueueTickFunction::bClearAfterExecute
protected

◆ bOpenAfterExecute

bool UE::Tick::FWorkQueueTickFunction::bOpenAfterExecute
protected

◆ bSetAsOpen

bool UE::Tick::FWorkQueueTickFunction::bSetAsOpen
protected

◆ DebugDetailString

FString UE::Tick::FWorkQueueTickFunction::DebugDetailString
protected

◆ DebugName

FName UE::Tick::FWorkQueueTickFunction::DebugName
protected

◆ QueuedWork

TArray<FWorkFunction> UE::Tick::FWorkQueueTickFunction::QueuedWork
protected

◆ WorkExecutionIndex

int32 UE::Tick::FWorkQueueTickFunction::WorkExecutionIndex
protected

The documentation for this struct was generated from the following files: