UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TAsyncGraphTask< ResultType > Class Template Reference

#include <Async.h>

+ Inheritance diagram for TAsyncGraphTask< ResultType >:

Public Member Functions

 TAsyncGraphTask (TUniqueFunction< ResultType()> &&InFunction, TPromise< ResultType > &&InPromise, ENamedThreads::Type InDesiredThread=ENamedThreads::AnyThread)
 
void DoTask (ENamedThreads::Type CurrentThread, const FGraphEventRef &MyCompletionGraphEvent)
 
ENamedThreads::Type GetDesiredThread ()
 
TFuture< ResultType > GetFuture ()
 
- Public Member Functions inherited from FAsyncGraphTaskBase
TStatId GetStatId () const
 

Additional Inherited Members

- Static Public Member Functions inherited from FAsyncGraphTaskBase
static ESubsequentsMode::Type GetSubsequentsMode ()
 

Detailed Description

template<typename ResultType>
class TAsyncGraphTask< ResultType >

Template for asynchronous functions that are executed in the Task Graph system.

Constructor & Destructor Documentation

◆ TAsyncGraphTask()

template<typename ResultType >
TAsyncGraphTask< ResultType >::TAsyncGraphTask ( TUniqueFunction< ResultType()> &&  InFunction,
TPromise< ResultType > &&  InPromise,
ENamedThreads::Type  InDesiredThread = ENamedThreads::AnyThread 
)
inline

Creates and initializes a new instance.

Parameters
InFunctionThe function to execute asynchronously.
InPromiseThe promise object used to return the function's result.

Member Function Documentation

◆ DoTask()

template<typename ResultType >
void TAsyncGraphTask< ResultType >::DoTask ( ENamedThreads::Type  CurrentThread,
const FGraphEventRef MyCompletionGraphEvent 
)
inline

Performs the actual task.

Parameters
CurrentThreadThe thread that this task is executing on.
MyCompletionGraphEventThe completion event.

◆ GetDesiredThread()

template<typename ResultType >
ENamedThreads::Type TAsyncGraphTask< ResultType >::GetDesiredThread ( )
inline

Returns the name of the thread that this task should run on.

Returns
Always run on any thread.

◆ GetFuture()

template<typename ResultType >
TFuture< ResultType > TAsyncGraphTask< ResultType >::GetFuture ( )
inline

Gets the future that will hold the asynchronous result.

Returns
A TFuture object.

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