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

#include <Future.h>

+ Inheritance diagram for TFutureState< ResultType >:

Public Types

using MutableResultType = typename TTypeCompatibleBytes< ResultType >::MutableGetType
 
using ConstResultType = typename TTypeCompatibleBytes< ResultType >::ConstGetType
 
using RvalueResultType = typename TTypeCompatibleBytes< ResultType >::RvalueGetType
 

Public Member Functions

 TFutureState ()
 
 ~TFutureState ()
 
 TFutureState (TUniqueFunction< void()> &&CompletionCallback)
 
MutableResultType GetResult ()
 
ConstResultType GetResult () const
 
template<typename... ArgTypes>
void EmplaceResult (ArgTypes &&... Args)
 
- Public Member Functions inherited from FFutureState
 FFutureState ()=default
 
 FFutureState (TUniqueFunction< void()> &&InCompletionCallback)
 
bool IsComplete () const
 
bool WaitFor (const FTimespan &Duration) const
 
void SetContinuation (TUniqueFunction< void()> &&Continuation)
 

Additional Inherited Members

- Protected Member Functions inherited from FFutureState
void MarkComplete ()
 

Detailed Description

template<typename ResultType>
class TFutureState< ResultType >

Implements the internal state of asynchronous return values (futures).

Member Typedef Documentation

◆ ConstResultType

template<typename ResultType >
using TFutureState< ResultType >::ConstResultType = typename TTypeCompatibleBytes<ResultType>::ConstGetType

◆ MutableResultType

template<typename ResultType >
using TFutureState< ResultType >::MutableResultType = typename TTypeCompatibleBytes<ResultType>::MutableGetType

◆ RvalueResultType

template<typename ResultType >
using TFutureState< ResultType >::RvalueResultType = typename TTypeCompatibleBytes<ResultType>::RvalueGetType

Constructor & Destructor Documentation

◆ TFutureState() [1/2]

template<typename ResultType >
TFutureState< ResultType >::TFutureState ( )
inline

Default constructor.

◆ ~TFutureState()

template<typename ResultType >
TFutureState< ResultType >::~TFutureState ( )
inline

◆ TFutureState() [2/2]

template<typename ResultType >
TFutureState< ResultType >::TFutureState ( TUniqueFunction< void()> &&  CompletionCallback)
inline

Create and initialize a new instance with a callback.

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

Member Function Documentation

◆ EmplaceResult()

template<typename ResultType >
template<typename... ArgTypes>
void TFutureState< ResultType >::EmplaceResult ( ArgTypes &&...  Args)
inline

Sets the result and notifies any waiting threads.

Parameters
ArgsThe arguments to forward to the constructor of the result.
See also
GetResult

◆ GetResult() [1/2]

template<typename ResultType >
MutableResultType TFutureState< ResultType >::GetResult ( )
inline

Gets the result (will block the calling thread until the result is available).

Returns
The result value.
See also
EmplaceResult

◆ GetResult() [2/2]

template<typename ResultType >
ConstResultType TFutureState< ResultType >::GetResult ( ) const
inline

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