engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
TPromise< ResultType > 模板类 参考

Template for promises. 更多...

#include <Future.h>

继承自 TPromiseBase< InternalResultType > .

Public 成员函数

template<typename... ArgTypes>
void EmplaceValue (ArgTypes &&... Args)
 Sets the promised result. 更多...
 
TFuture< ResultType > GetFuture ()
 Gets a TFuture object associated with the shared state of this promise. 更多...
 
TPromise & operator= (TPromise &&Other)
 Move assignment operator. 更多...
 
FORCEINLINE void SetValue (const ResultType &Result)
 Sets the promised result. 更多...
 
FORCEINLINE void SetValue (ResultType &&Result)
 Sets the promised result (from rvalue). 更多...
 
 TPromise ()
 Default constructor (creates a new shared state).
 
 TPromise (TPromise &&Other)
 Move constructor. 更多...
 
 TPromise (TUniqueFunction< void()> &&CompletionCallback)
 Create and initialize a new instance with a callback. 更多...
 

详细描述

template<typename ResultType>
class TPromise< ResultType >

Template for promises.

构造及析构函数说明

◆ TPromise() [1/2]

template<typename ResultType >
TPromise< ResultType >::TPromise ( TPromise< ResultType > &&  Other)
inline

Move constructor.

参数
OtherThe promise holding the shared state to move.

◆ TPromise() [2/2]

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

Create and initialize a new instance with a callback.

参数
CompletionCallbackA function that is called when the future state is completed.

成员函数说明

◆ EmplaceValue()

template<typename ResultType >
template<typename... ArgTypes>
void TPromise< ResultType >::EmplaceValue ( ArgTypes &&...  Args)
inline

Sets the promised result.

The result must be set only once. An assertion will be triggered if this method is called a second time.

参数
ResultThe result value to set.

◆ GetFuture()

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

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

返回
The TFuture object.

◆ operator=()

template<typename ResultType >
TPromise & TPromise< ResultType >::operator= ( TPromise< ResultType > &&  Other)
inline

Move assignment operator.

参数
OtherThe promise holding the shared state to move.

◆ SetValue() [1/2]

template<typename ResultType >
FORCEINLINE void TPromise< ResultType >::SetValue ( const ResultType &  Result)
inline

Sets the promised result.

The result must be set only once. An assertion will be triggered if this method is called a second time.

参数
ResultThe result value to set.

◆ SetValue() [2/2]

template<typename ResultType >
FORCEINLINE void TPromise< ResultType >::SetValue ( ResultType &&  Result)
inline

Sets the promised result (from rvalue).

The result must be set only once. An assertion will be triggered if this method is called a second time.

参数
ResultThe result value to set.

该类的文档由以下文件生成: