UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
UE::Interchange::FInterchangeTaskSystem Class Reference

#include <InterchangeTaskSystem.h>

Public Member Functions

 FInterchangeTaskSystem ()
 
INTERCHANGECORE_API uint64 AddTask (TSharedPtr< FInterchangeTaskBase, ESPMode::ThreadSafe > Task, TArray< uint64 > &TaskPrerequisites)
 
INTERCHANGECORE_API uint64 AddTask (TSharedPtr< FInterchangeTaskBase, ESPMode::ThreadSafe > Task)
 
INTERCHANGECORE_API EInterchangeTaskStatus GetTaskStatus (const uint64 TaskId) const
 
INTERCHANGECORE_API void CancelTask (const uint64 TaskId, const bool bCancelPrerequisites)
 
INTERCHANGECORE_API void WaitUntilTasksComplete (const TArray< uint64 > &TasksToComplete)
 
FOnInterchangeTaskSystemTickOnTaskSystemTickDelegate ()
 

Static Public Member Functions

static INTERCHANGECORE_API FInterchangeTaskSystemGet ()
 

Constructor & Destructor Documentation

◆ FInterchangeTaskSystem()

UE::Interchange::FInterchangeTaskSystem::FInterchangeTaskSystem ( )

The constructor should not be called directly, an ensure will be set if its the case Use the static Get function to acces the singleton.

Member Function Documentation

◆ AddTask() [1/2]

uint64 UE::Interchange::FInterchangeTaskSystem::AddTask ( TSharedPtr< FInterchangeTaskBase, ESPMode::ThreadSafe Task)

Add a task without prerequisite. Return the task id. If there is an issue the returned task id will be INTERCHANGE_INVALID_TASK_ID The task will start when some thread resource will be available.

◆ AddTask() [2/2]

uint64 UE::Interchange::FInterchangeTaskSystem::AddTask ( TSharedPtr< FInterchangeTaskBase, ESPMode::ThreadSafe Task,
TArray< uint64 > &  TaskPrerequisites 
)

Add a task with some prerequisites. Return the task id. If there is an issue the returned task id will be INTERCHANGE_INVALID_TASK_ID The task will start when all prerequisites are done and some thread resource will be available.

◆ CancelTask()

void UE::Interchange::FInterchangeTaskSystem::CancelTask ( const uint64  TaskId,
const bool  bCancelPrerequisites 
)

Cancel a task, you can control if you cancel also the prerequisites, and subsequents. Canceling a task that is waiting will simply push it state to Done which will allow subsequent to be executed.

◆ Get()

UE::Interchange::FInterchangeTaskSystem & UE::Interchange::FInterchangeTaskSystem::Get ( )
static

◆ GetTaskStatus()

UE::Interchange::EInterchangeTaskStatus UE::Interchange::FInterchangeTaskSystem::GetTaskStatus ( const uint64  TaskId) const

Return the current task status

◆ OnTaskSystemTickDelegate()

FOnInterchangeTaskSystemTick & UE::Interchange::FInterchangeTaskSystem::OnTaskSystemTickDelegate ( )
inline

◆ WaitUntilTasksComplete()

void UE::Interchange::FInterchangeTaskSystem::WaitUntilTasksComplete ( const TArray< uint64 > &  TasksToComplete)

Wait can be call only on game thread. Async thread wait can create dead lock by using all the thread resources.

The caller have some restriction to follow

  • This must be a safe place for any game thread task that will be executing during the wait.
  • Wait should not happen from a package/asset load call stack
  • Wait should not happen from a save package/asset call stack
  • Wait should not happen from a garbage collect call stack

If your system need to wait and you already have some locks or you are under a unsafe place you need to redesign your system to move the wait before you get to a unsafe call stack place to wait.


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