class TAsyncOp

template<typename ReturnType>
Inherits: AsyncOp

Object you may use to check on the results of an asynchronous operation.

Contains uninitialized data until HasCompleted() returns true.

Public

Constructors

TAsyncOp<ReturnType>

TAsyncOp<ReturnType>()

TAsyncOp<ReturnType>

TAsyncOp<ReturnType>(AsyncOpEmpty empty)

TAsyncOp<ReturnType>

TAsyncOp<ReturnType>(const TAsyncOp<ReturnType> &other) = default

TAsyncOp<ReturnType>

TAsyncOp<ReturnType>(TAsyncOp<ReturnType> &&other)

TAsyncOp

TAsyncOp()

TAsyncOp

TAsyncOp(AsyncOpEmpty empty)

TAsyncOp

TAsyncOp(const TAsyncOp<void> &other) = default

TAsyncOp

TAsyncOp(TAsyncOp<void> &&other)

Methods

GetReturnValue

ReturnType GetReturnValue() const

Retrieves the value returned by the async operation.

Only valid if HasCompleted() returns true.

Returns: Copy of the return value. Returns by value for thread safety.

Operators

operator=

TAsyncOp<ReturnType> &operator=(const TAsyncOp<ReturnType> &other) = default

operator=

TAsyncOp<ReturnType> &operator=(TAsyncOp<ReturnType> &&other)

operator=

TAsyncOp<void> &operator=(const TAsyncOp<void> &other) = default

operator=

TAsyncOp<void> &operator=(TAsyncOp<void> &&other)

Internal

Methods

CompleteOperation

void CompleteOperation()

Mark the async operation as completed, without setting a return value.

CompleteOperation

void CompleteOperation(const ReturnType &returnValue)

Mark the async operation as completed with the given return value (copy).

CompleteOperation

void CompleteOperation(ReturnType &&returnValue)

Mark the async operation as completed with the given return value (move).

CompleteOperation

void CompleteOperation()

Mark the async operation as completed (no return value).

Private

Methods

staticCreateData

static SPtr<AsyncOpDataBase> CreateData()

Creates typed data with custom deleter and sets up type-erased value extractor.

staticCreateData

static SPtr<AsyncOpDataBase> CreateData()

Creates typed data with custom deleter and sets up type-erased value extractor.