|
using | TaskCallback = std::function<Value()> |
|
using | OnSuccessCallback = typename OnSuccessCallback<Value>::type |
|
|
| Future (TaskCallback task=nullptr) |
|
const _< CancellationWrapper< Inner > > & | inner () const noexcept |
|
bool | isWaitNeeded () const noexcept |
|
bool | hasResult () const noexcept |
|
bool | hasValue () const noexcept |
|
void | reportException () const noexcept |
|
template<typename Callback> |
void | onSuccess (Callback &&callback) const |
|
template<aui::invocable< const AException & > Callback> |
void | onError (Callback &&callback) const |
|
template<aui::invocable Callback> |
void | onFinally (Callback &&callback) const |
| Adds the callback to both onSuccess and onResult.
|
|
void | cancel () const noexcept |
| Cancels the AFuture's task.
|
|
void | reportInterrupted () const |
|
void | wait (AFutureWait flags=AFutureWait::DEFAULT) const |
| Sleeps if the supplyValue is not currently available.
|
|
FutureReturnType< Value >::type | get (AFutureWait flags=AFutureWait::DEFAULT) const |
| Returns the supplyValue from the another thread. Sleeps if the supplyValue is not currently available.
|
|
FutureReturnType< Value >::type | operator* () const |
| Returns the task result from the another thread. Sleeps if the task result is not currently available.
|
|
FutureReturnType< Value >::type | operator* () |
| Returns the supplyValue from the another thread. Sleeps if the supplyValue is not currently available.
|
|
Value * | operator-> () const |
| Returns the supplyValue from the another thread. Sleeps if the supplyValue is not currently available.
|
|
|
static constexpr bool | isVoid = std::is_same_v<void, Value> |
|
◆ Future()
template<typename Value = void>
◆ cancel()
template<typename Value = void>
◆ get()
template<typename Value = void>
Returns the supplyValue from the another thread. Sleeps if the supplyValue is not currently available.
- Sneaky exceptions
AInvoсationTargetException
thrown if invocation target has thrown an exception.
- Returns
- the object stored from the another thread.
◆ hasResult()
template<typename Value = void>
- Returns
- true if the value or exception or interruption was received.
◆ hasValue()
template<typename Value = void>
- Returns
- true if asynchronous operation was successfuly completed and supplied a value, which can be obtained without waiting.
◆ isWaitNeeded()
template<typename Value = void>
- Returns
- true if call to wait() function would cause thread block.
◆ operator*() [1/2]
template<typename Value = void>
Returns the supplyValue from the another thread. Sleeps if the supplyValue is not currently available.
- Sneaky exceptions
AInvoсationTargetException
thrown if invocation target has thrown an exception.
- Returns
- the object stored from the another thread.
◆ operator*() [2/2]
template<typename Value = void>
Returns the task result from the another thread. Sleeps if the task result is not currently available.
- Sneaky exceptions
AInvoсationTargetException
thrown if invocation target has thrown an exception.
- Returns
- the object stored from the another thread.
◆ operator->()
template<typename Value = void>
Returns the supplyValue from the another thread. Sleeps if the supplyValue is not currently available.
- Sneaky exceptions
AInvoсationTargetException
thrown if invocation target has thrown an exception.
- Returns
- the object stored from the another thread.
◆ wait()
template<typename Value = void>
Sleeps if the supplyValue is not currently available.
- Note
- The task will be executed inside wait() function if the threadpool have not taken the task to execute yet. This behaviour can be disabled by
AFutureWait::JUST_WAIT
flag.
The documentation for this class was generated from the following file: