MCRO
C++23 utilities for Unreal Engine.
Loading...
Searching...
No Matches
Mcro::Threading Namespace Reference

Namespaces

namespace  Detail
 

Functions

MCRO_API bool IsInThread (ENamedThreads::Type threadName)
 
MCRO_API void RunInThread (ENamedThreads::Type threadName, TUniqueFunction< void()> &&func)
 
MCRO_API void RunInThread (ENamedThreads::Type threadName, const UObject *boundToObject, TUniqueFunction< void()> &&func)
 
MCRO_API void RunInThread (ENamedThreads::Type threadName, const FWeakObjectPtr &boundToObject, TUniqueFunction< void()> &&func)
 
MCRO_API void RunInGameThread (TUniqueFunction< void()> &&func)
 
MCRO_API void RunInGameThread (const UObject *boundToObject, TUniqueFunction< void()> &&func)
 
MCRO_API void RunInGameThread (const FWeakObjectPtr &boundToObject, TUniqueFunction< void()> &&func)
 
MCRO_API void EnqueueRenderCommand (TUniqueFunction< void(FRHICommandListImmediate &)> &&func)
 
MCRO_API void EnqueueRenderCommand (const UObject *boundToObject, TUniqueFunction< void(FRHICommandListImmediate &)> &&func)
 
MCRO_API void EnqueueRenderCommand (const FWeakObjectPtr &boundToObject, TUniqueFunction< void(FRHICommandListImmediate &)> &&func)
 
template<CSharedOrWeak Object>
void RunInThread (ENamedThreads::Type threadName, const Object &boundToObject, TUniqueFunction< void()> &&func)
 
template<CSharedOrWeak Object>
void RunInGameThread (const Object &boundToObject, TUniqueFunction< void()> &&func)
 
template<CSharedOrWeak Object>
void EnqueueRenderCommand (const Object &boundToObject, TUniqueFunction< void(FRHICommandListImmediate &)> &&func)
 
template<CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > PromiseInThread (ENamedThreads::Type threadName, Function &&func)
 
template<CSharedOrWeak Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > PromiseInThread (ENamedThreads::Type threadName, const Object &boundToObject, Function &&func)
 
template<CUObject Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > PromiseInThread (ENamedThreads::Type threadName, const Object *boundToObject, Function &&func)
 
template<CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > PromiseInGameThread (Function &&func)
 
template<CSharedOrWeak Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > PromiseInGameThread (const Object &boundToObject, Function &&func)
 
template<CUObject Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > PromiseInGameThread (const Object *boundToObject, Function &&func)
 
template<CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires ( TFunction_ArgCount<Function> == 1 && CSameAs<FRHICommandListImmediate&, TFunction_Arg<Function, 0>> )
TFuture< Result > EnqueueRenderPromise (Function &&func)
 
template<CSharedOrWeak Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires ( TFunction_ArgCount<Function> == 1 && CSameAs<FRHICommandListImmediate&, TFunction_Arg<Function, 0>> )
TFuture< Result > EnqueueRenderPromise (const Object &boundToObject, Function &&func)
 
template<CUObject Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires ( TFunction_ArgCount<Function> == 1 && CSameAs<FRHICommandListImmediate&, TFunction_Arg<Function, 0>> )
TFuture< Result > EnqueueRenderPromise (const Object *boundToObject, Function &&func)
 

Function Documentation

◆ EnqueueRenderCommand() [1/4]

MCRO_API void Mcro::Threading::EnqueueRenderCommand ( const FWeakObjectPtr & boundToObject,
TUniqueFunction< void(FRHICommandListImmediate &)> && func )

Simply run a lambda function on the render thread but only use AsyncTask if it's not on the render thread already Check the validity of a target object first before running on the render thread.

◆ EnqueueRenderCommand() [2/4]

template<CSharedOrWeak Object>
void Mcro::Threading::EnqueueRenderCommand ( const Object & boundToObject,
TUniqueFunction< void(FRHICommandListImmediate &)> && func )

Simply run a lambda function on the game thread but only use AsyncTask if it's not on the game thread already Check the validity of a target object first before running on the game thread.

Definition at line 185 of file Threading.h.

◆ EnqueueRenderCommand() [3/4]

MCRO_API void Mcro::Threading::EnqueueRenderCommand ( const UObject * boundToObject,
TUniqueFunction< void(FRHICommandListImmediate &)> && func )

Simply run a lambda function on the render thread but only use AsyncTask if it's not on the render thread already Check the validity of a target object first before running on the render thread.

◆ EnqueueRenderCommand() [4/4]

MCRO_API void Mcro::Threading::EnqueueRenderCommand ( TUniqueFunction< void(FRHICommandListImmediate &)> && func)

Simply run a lambda function on the render thread but only use AsyncTask if it's not on the render thread already

◆ EnqueueRenderPromise() [1/3]

template<CSharedOrWeak Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires ( TFunction_ArgCount<Function> == 1 && CSameAs<FRHICommandListImmediate&, TFunction_Arg<Function, 0>> )
TFuture< Result > Mcro::Threading::EnqueueRenderPromise ( const Object & boundToObject,
Function && func )

Simply run a lambda function on the render thread but only use AsyncTask if it's not on the render thread already Check the validity of a target object first before running on the render thread.

Definition at line 326 of file Threading.h.

◆ EnqueueRenderPromise() [2/3]

template<CUObject Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires ( TFunction_ArgCount<Function> == 1 && CSameAs<FRHICommandListImmediate&, TFunction_Arg<Function, 0>> )
TFuture< Result > Mcro::Threading::EnqueueRenderPromise ( const Object * boundToObject,
Function && func )

Simply run a lambda function on the render thread but only use AsyncTask if it's not on the render thread already Check the validity of a target object first before running on the render thread.

Definition at line 348 of file Threading.h.

◆ EnqueueRenderPromise() [3/3]

template<CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires ( TFunction_ArgCount<Function> == 1 && CSameAs<FRHICommandListImmediate&, TFunction_Arg<Function, 0>> )
TFuture< Result > Mcro::Threading::EnqueueRenderPromise ( Function && func)

Simply run a lambda function on the render thread but only use AsyncTask if it's not on the render thread already This overload doesn't check object lifespans.

Definition at line 308 of file Threading.h.

◆ IsInThread()

MCRO_API bool Mcro::Threading::IsInThread ( ENamedThreads::Type threadName)

Returns true when called in the thread which is associated with the given ENamedThreads. If there's no such a thread or if this function is not called in that thread, return false.

◆ PromiseInGameThread() [1/3]

template<CSharedOrWeak Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > Mcro::Threading::PromiseInGameThread ( const Object & boundToObject,
Function && func )

Simply run a lambda function on the game thread but only use AsyncTask if it's not on the game thread already Check the validity of a target object first before running on the game thread.

Definition at line 269 of file Threading.h.

◆ PromiseInGameThread() [2/3]

template<CUObject Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > Mcro::Threading::PromiseInGameThread ( const Object * boundToObject,
Function && func )

Simply run a lambda function on the game thread but only use AsyncTask if it's not on the game thread already Check the validity of a target object first before running on the game thread.

Definition at line 288 of file Threading.h.

◆ PromiseInGameThread() [3/3]

template<CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > Mcro::Threading::PromiseInGameThread ( Function && func)

Simply run a lambda function on the game thread but only use AsyncTask if it's not on the game thread already This overload doesn't check object lifespans.

Definition at line 254 of file Threading.h.

◆ PromiseInThread() [1/3]

template<CSharedOrWeak Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > Mcro::Threading::PromiseInThread ( ENamedThreads::Type threadName,
const Object & boundToObject,
Function && func )

Simply run a lambda function on the selected thread but only use AsyncTask if it's not on the selected thread already Check the validity of a target object first before running on the selected thread.

Definition at line 218 of file Threading.h.

◆ PromiseInThread() [2/3]

template<CUObject Object, CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > Mcro::Threading::PromiseInThread ( ENamedThreads::Type threadName,
const Object * boundToObject,
Function && func )

Simply run a lambda function on the selected thread but only use AsyncTask if it's not on the selected thread already Check the validity of a target object first before running on the selected thread.

Definition at line 237 of file Threading.h.

◆ PromiseInThread() [3/3]

template<CFunctorObject Function, typename Result = TFunction_Return<Function>>
requires (TFunction_ArgCount<Function> == 0)
TFuture< Result > Mcro::Threading::PromiseInThread ( ENamedThreads::Type threadName,
Function && func )

Simply run a lambda function on the selected thread but only use AsyncTask if it's not on the selected thread already This overload doesn't check object lifespans.

Definition at line 203 of file Threading.h.

◆ RunInGameThread() [1/4]

MCRO_API void Mcro::Threading::RunInGameThread ( const FWeakObjectPtr & boundToObject,
TUniqueFunction< void()> && func )

Simply run a lambda function on the game thread but only use AsyncTask if it's not on the game thread already Check the validity of a target object first before running on the game thread.

◆ RunInGameThread() [2/4]

template<CSharedOrWeak Object>
void Mcro::Threading::RunInGameThread ( const Object & boundToObject,
TUniqueFunction< void()> && func )

Simply run a lambda function on the game thread but only use AsyncTask if it's not on the game thread already Check the validity of a target object first before running on the game thread.

Definition at line 175 of file Threading.h.

◆ RunInGameThread() [3/4]

MCRO_API void Mcro::Threading::RunInGameThread ( const UObject * boundToObject,
TUniqueFunction< void()> && func )

Simply run a lambda function on the game thread but only use AsyncTask if it's not on the game thread already Check the validity of a target object first before running on the game thread.

◆ RunInGameThread() [4/4]

MCRO_API void Mcro::Threading::RunInGameThread ( TUniqueFunction< void()> && func)

Simply run a lambda function on the game thread but only use AsyncTask if it's not on the game thread already

◆ RunInThread() [1/4]

MCRO_API void Mcro::Threading::RunInThread ( ENamedThreads::Type threadName,
const FWeakObjectPtr & boundToObject,
TUniqueFunction< void()> && func )

Simply run a lambda function on the selected thread but only use AsyncTask if it's not on the selected thread already check the validity of a target object first before running on the selected thread.

◆ RunInThread() [2/4]

template<CSharedOrWeak Object>
void Mcro::Threading::RunInThread ( ENamedThreads::Type threadName,
const Object & boundToObject,
TUniqueFunction< void()> && func )

Simply run a lambda function on the selected thread but only use AsyncTask if it's not on the selected thread already Check the validity of a target object first before running on the selected thread.

Definition at line 161 of file Threading.h.

◆ RunInThread() [3/4]

MCRO_API void Mcro::Threading::RunInThread ( ENamedThreads::Type threadName,
const UObject * boundToObject,
TUniqueFunction< void()> && func )

Simply run a lambda function on the selected thread but only use AsyncTask if it's not on the selected thread already check the validity of a target object first before running on the selected thread.

◆ RunInThread() [4/4]

MCRO_API void Mcro::Threading::RunInThread ( ENamedThreads::Type threadName,
TUniqueFunction< void()> && func )

Simply run a lambda function on the selected thread but only use AsyncTask if it's not on the selected thread already