TPromise

Template for promises.

Choose your operating system:

Windows

macOS

Linux

Inheritance Hierarchy

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Async/Future.h

Include

#include "Async/Future.h"

Syntax

template<typename ResultType>
class TPromise : public TPromiseBase< ResultType >

Remarks

Template for promises.

Constructors

Name Description

Public function

TPromise()

Default constructor (creates a new shared state).

Public function

TPromise

(
    TPromise&& Other
)

Move constructor.

Public function

TPromise

(
    TUniqueFunction< void()>&& Complet...
)

Create and initialize a new instance with a callback.

Functions

Name Description

Public function

void

 

EmplaceValue

(
    ArgTypes&&... Args
)

Sets the promised result.

Public function

TFuture< Res...

 

GetFuture()

Gets a TFuture object associated with the shared state of this promise.

Public function

void

 

SetValue

(
    const ResultType& Result
)

Sets the promised result.

Public function

void

 

SetValue

(
    ResultType&& Result
)

Sets the promised result (from rvalue).

Operators

Name Description

Public function

TPromise &

 

operator=

(
    TPromise&& Other
)

Move assignment operator.

Typedefs

Name

Description

BaseType