RapyutaSimulationPlugins
Static Public Member Functions | List of all members
URRThreadUtils Class Reference

ThreadUtils with Async. More...

#include <RRThreadUtils.h>

Inheritance diagram for URRThreadUtils:
Inheritance graph
[legend]
Collaboration diagram for URRThreadUtils:
Collaboration graph
[legend]

Static Public Member Functions

static bool IsInsideConstructor ()
 return true if called inside constructor. More...
 
template<typename TFunc , typename... TArgs>
static void DoTaskInGameThread (TFunc &&InTaskInGameThread, TArgs &&... InArgs)
 Used in URRProceduralMeshComponent. More...
 
template<typename TFunc , typename... TArgs>
static void DoTaskInGameThreadLater (TFunc &&InTaskInGameThread, float InWaitingTime, TArgs &&... Args)
 
template<typename TResult >
static auto DoAsyncTaskInThread (TFunction< TResult()> InTask, TFunction< void()> InCompletionCallback, const EAsyncExecution InExecutionThread=EAsyncExecution::ThreadPool)
 
template<typename TResult >
static void AddAsyncTaskInThreadPool (FRRAsyncJob &OutAsyncJob, const uint64 InCurrentCaptureBatchId, TFunction< TResult()> InTask, TFunction< void()> InCompletionCallback)
 
template<typename TResult >
static void AddAsyncTaskToJob (FRRAsyncJob &OutAsyncJob, const uint64 InCurrentCaptureBatchId, TFunction< TResult()> InTask, TFunction< void()> InCompletionCallback, const EAsyncExecution InExecutionThread=EAsyncExecution::ThreadPool)
 
template<typename TAsyncTask >
static void EnsureAsyncTasksCompletion (const TArray< TUniquePtr< FAsyncTask< TAsyncTask >>> &InAsyncTasks)
 

Detailed Description

ThreadUtils with Async.

See also
Async

UCLASS()

Member Function Documentation

◆ AddAsyncTaskInThreadPool()

template<typename TResult >
static void URRThreadUtils::AddAsyncTaskInThreadPool ( FRRAsyncJob OutAsyncJob,
const uint64  InCurrentCaptureBatchId,
TFunction< TResult()>  InTask,
TFunction< void()>  InCompletionCallback 
)
inlinestatic

◆ AddAsyncTaskToJob()

template<typename TResult >
static void URRThreadUtils::AddAsyncTaskToJob ( FRRAsyncJob OutAsyncJob,
const uint64  InCurrentCaptureBatchId,
TFunction< TResult()>  InTask,
TFunction< void()>  InCompletionCallback,
const EAsyncExecution  InExecutionThread = EAsyncExecution::ThreadPool 
)
inlinestatic

◆ DoAsyncTaskInThread()

template<typename TResult >
static auto URRThreadUtils::DoAsyncTaskInThread ( TFunction< TResult()>  InTask,
TFunction< void()>  InCompletionCallback,
const EAsyncExecution  InExecutionThread = EAsyncExecution::ThreadPool 
)
inlinestatic

◆ DoTaskInGameThread()

template<typename TFunc , typename... TArgs>
static void URRThreadUtils::DoTaskInGameThread ( TFunc &&  InTaskInGameThread,
TArgs &&...  InArgs 
)
inlinestatic

Used in URRProceduralMeshComponent.

UE has equivalent ones of [std::forward] as Forward, [std::make_tuple] as MakeTuple,

but does not have one for [std::apply] :(

See also
https://stackoverflow.com/questions/47496358/c-lambdas-how-to-capture-variadic-parameter-pack-from-the-upper-scope

◆ DoTaskInGameThreadLater()

template<typename TFunc , typename... TArgs>
static void URRThreadUtils::DoTaskInGameThreadLater ( TFunc &&  InTaskInGameThread,
float  InWaitingTime,
TArgs &&...  Args 
)
inlinestatic

◆ EnsureAsyncTasksCompletion()

template<typename TAsyncTask >
static void URRThreadUtils::EnsureAsyncTasksCompletion ( const TArray< TUniquePtr< FAsyncTask< TAsyncTask >>> &  InAsyncTasks)
inlinestatic

◆ IsInsideConstructor()

static bool URRThreadUtils::IsInsideConstructor ( )
inlinestatic

return true if called inside constructor.

Returns
true
false

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