|
|
| Future ()=default |
| | Default Constructor.
|
|
| Future (std::shared_ptr< impl::Promise< Exception, Result... > > impl) noexcept |
|
| Future (Future &&)=default |
|
| Future (const Future &)=delete |
|
Future & | operator= (Future &&)=default |
|
Future & | operator= (const Future &)=delete |
| const Future & | then (ResolveFn resolve) const & |
| | Set continuation callback.
|
| Future | then (ResolveFn resolve) && |
| | Set continuation callback.
|
| const Future & | handle_exception (RejectFn reject) const & |
| | Set error handling callback.
|
| Future | handle_exception (RejectFn reject) && |
| | Set error handling callback.
|
| bool | empty () const noexcept |
|
bool | operator== (const Future &other) const noexcept |
| | Equal comparsion.
|
template<class
Exception, class... Result>
class PdCom::Future< Exception, Result >
Callback management handle.
This class can save up to two callbacks for an asynchronous operation. When the result of the asynchronous operation arrives, the callback set by then() is called. On error, handle_exception() is invoked.
Please note that this Future does not support fire-and-forget. The Future should be kept until one of the callback was called. If you're not interested in the result anymore, you can delete the future. In this case, no callbacks are run.