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

Abstract base template for futures and shared futures. 更多...

#include <Future.h>

+ 类 TFutureBase< InternalResultType > 继承关系图:

Public 成员函数

bool IsReady () const
 Checks whether this future object has its value set. 更多...
 
bool IsValid () const
 Checks whether this future object has a valid state. 更多...
 
void Wait () const
 Blocks the calling thread until the future result is available. 更多...
 
bool WaitFor (const FTimespan &Duration) const
 Blocks the calling thread until the future result is available or the specified duration is exceeded. 更多...
 
bool WaitUntil (const FDateTime &Time) const
 Blocks the calling thread until the future result is available or the specified time is hit. 更多...
 

Protected 成员函数

const StateType & GetState () const
 Gets the shared state object. 更多...
 
template<typename Func >
auto Next (Func Continuation)
 Convenience wrapper for Then that set a completion callback that will be called once the future completes or immediately if already completed 更多...
 
TFutureBase & operator= (const TFutureBase &)=default
 Protected copy assignment
 
TFutureBase & operator= (TFutureBase &&)=default
 Protected move assignment
 
void Reset ()
 Reset the future. 更多...
 
 TFutureBase ()
 Default constructor.
 
 TFutureBase (const StateType &InState)
 Creates and initializes a new instance. 更多...
 
 TFutureBase (const TFutureBase &)=default
 Protected copy construction
 
 TFutureBase (TFutureBase &&)=default
 Protected move construction
 
template<typename Func >
auto Then (Func Continuation)
 Set a completion callback that will be called once the future completes or immediately if already completed 更多...
 
 ~TFutureBase ()
 Protected destructor.
 

详细描述

template<typename InternalResultType>
class TFutureBase< InternalResultType >

Abstract base template for futures and shared futures.

构造及析构函数说明

◆ TFutureBase()

template<typename InternalResultType >
TFutureBase< InternalResultType >::TFutureBase ( const StateType &  InState)
inlineprotected

Creates and initializes a new instance.

参数
InStateThe shared state to initialize with.

成员函数说明

◆ GetState()

template<typename InternalResultType >
const StateType & TFutureBase< InternalResultType >::GetState ( ) const
inlineprotected

Gets the shared state object.

返回
The shared state object.

◆ IsReady()

template<typename InternalResultType >
bool TFutureBase< InternalResultType >::IsReady ( ) const
inline

Checks whether this future object has its value set.

返回
true if this future has a shared state and the value has been set, false otherwise.
参见
IsValid

◆ IsValid()

template<typename InternalResultType >
bool TFutureBase< InternalResultType >::IsValid ( ) const
inline

Checks whether this future object has a valid state.

返回
true if the state is valid, false otherwise.
参见
IsReady

◆ Next()

template<typename InternalResultType >
template<typename Func >
auto TFutureBase< InternalResultType >::Next ( Func  Continuation)
protected

Convenience wrapper for Then that set a completion callback that will be called once the future completes or immediately if already completed

参数
Continuationa continuation taking an argument of type InternalResultType
返回
nothing at the moment but could return another future to allow future chaining

◆ Reset()

template<typename InternalResultType >
void TFutureBase< InternalResultType >::Reset ( )
inlineprotected

Reset the future.

Reseting a future removes any continuation from its shared state and invalidates it. Useful for discarding yet to be completed future cleanly.

◆ Then()

template<typename InternalResultType >
template<typename Func >
auto TFutureBase< InternalResultType >::Then ( Func  Continuation)
protected

Set a completion callback that will be called once the future completes or immediately if already completed

参数
Continuationa continuation taking an argument of type TFuture<InternalResultType>
返回
nothing at the moment but could return another future to allow future chaining

◆ Wait()

template<typename InternalResultType >
void TFutureBase< InternalResultType >::Wait ( ) const
inline

Blocks the calling thread until the future result is available.

Note that this method may block forever if the result is never set. Use the WaitFor or WaitUntil methods to specify a maximum timeout for the wait.

参见
WaitFor, WaitUntil

◆ WaitFor()

template<typename InternalResultType >
bool TFutureBase< InternalResultType >::WaitFor ( const FTimespan &  Duration) const
inline

Blocks the calling thread until the future result is available or the specified duration is exceeded.

参数
DurationThe maximum time span to wait for the future result.
返回
true if the result is available, false otherwise.
参见
Wait, WaitUntil

◆ WaitUntil()

template<typename InternalResultType >
bool TFutureBase< InternalResultType >::WaitUntil ( const FDateTime &  Time) const
inline

Blocks the calling thread until the future result is available or the specified time is hit.

参数
TimeThe time until to wait for the future result (in UTC).
返回
true if the result is available, false otherwise.
参见
Wait, WaitUntil

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