UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
FFutureState Class Reference

#include <Future.h>

+ Inheritance diagram for FFutureState:

Public Member Functions

 FFutureState ()=default
 
 FFutureState (TUniqueFunction< void()> &&InCompletionCallback)
 
bool IsComplete () const
 
bool WaitFor (const FTimespan &Duration) const
 
void SetContinuation (TUniqueFunction< void()> &&Continuation)
 

Protected Member Functions

void MarkComplete ()
 

Detailed Description

Base class for the internal state of asynchronous return values (futures).

Constructor & Destructor Documentation

◆ FFutureState() [1/2]

FFutureState::FFutureState ( )
default

Default constructor.

◆ FFutureState() [2/2]

FFutureState::FFutureState ( TUniqueFunction< void()> &&  InCompletionCallback)
inline

Create and initialize a new instance with a callback.

Parameters
InCompletionCallbackA function that is called when the state is completed.

Member Function Documentation

◆ IsComplete()

bool FFutureState::IsComplete ( ) const
inline

Checks whether the asynchronous result has been set.

Returns
true if the result has been set, false otherwise.
See also
WaitFor

◆ MarkComplete()

void FFutureState::MarkComplete ( )
inlineprotected

Notifies any waiting threads that the result is available.

◆ SetContinuation()

void FFutureState::SetContinuation ( TUniqueFunction< void()> &&  Continuation)
inline

Set a continuation to be called on completion of the promise

Parameters
Continuation

◆ WaitFor()

bool FFutureState::WaitFor ( const FTimespan Duration) const
inline

Blocks the calling thread until the future result is available.

Parameters
DurationThe maximum time span to wait for the future result.
Returns
true if the result is available, false otherwise.
See also
IsComplete

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