|
ORIGINAL
|
Represents a one-shot future result of an asynchronous computation. More...
#include <async.h>


Public Member Functions | |
| future (const future &)=delete | |
| future & | operator= (const future &)=delete |
| future (future &&)=default | |
| future & | operator= (future &&)=default |
| bool | valid () const noexcept override |
| Checks if the future is valid (has an associated async wrapper) | |
| sharedFuture< TYPE > | share () |
| Converts this future to a shared future. | |
| TYPE | result () |
| Gets the result (blocks until ready) | |
| bool | ready () const override |
| Checks if the result is ready. | |
| std::exception_ptr | exception () const noexcept override |
| Gets the exception if computation failed. | |
| void | wait () const override |
| Waits until the result becomes ready. | |
| bool | waitFor (time::duration timeout) const override |
| Waits for the result with a timeout. | |
Friends | |
| class | async |
Represents a one-shot future result of an asynchronous computation.
| TYPE | The result type of the computation |
future allows retrieving the result exactly once. After consumption, the value is moved out of storage.
|
overridevirtualnoexcept |
Gets the exception if computation failed.
Implements original::async::futureBase.
|
overridevirtual |
Checks if the result is ready.
Implements original::async::futureBase.
| TYPE original::async::future< TYPE >::result | ( | ) |
Gets the result (blocks until ready)
| std::exception | if the computation threw an exception |
| original::async::sharedFuture< TYPE > original::async::future< TYPE >::share | ( | ) |
Converts this future to a shared future.
|
overridevirtualnoexcept |
Checks if the future is valid (has an associated async wrapper)
Implements original::async::futureBase.
|
overridevirtual |
Waits until the result becomes ready.
Implements original::async::futureBase.
|
overridevirtual |
Waits for the result with a timeout.
| timeout | Maximum time to wait |
Implements original::async::futureBase.