#include <future_fwd.hpp>
template<typename T>
class qi::Promise< T >
A Promise is used to create and satisfy a Future.
Definition at line 63 of file future_fwd.hpp.
Create a standard promise.
- Parameters
-
| async | specify how callbacks registered with Future::connect are called: synchronously from the Promise setter, or asynchronously from a thread pool. |
Definition at line 650 of file future_fwd.hpp.
Get a future linked to this promise. Can be called multiple times.
Definition at line 708 of file future_fwd.hpp.
return true if cancel has been called on the promise (even if the cancel callback did not run yet).
Definition at line 703 of file future_fwd.hpp.
set the cancel state, and notify all futures throw if state != running
Definition at line 696 of file future_fwd.hpp.
template<typename T>
| void qi::Promise< T >::setError |
( |
const std::string & |
msg | ) |
|
|
inline |
set the error, and notify all futures throw if state != running
Definition at line 689 of file future_fwd.hpp.
Set a cancel callback. If the cancel is requested, calls this callback immediately.
- Exceptions
-
| std::exception | if the promise was not created as a cancelable promise. |
Definition at line 724 of file future_fwd.hpp.
notify all future that a value has been set. throw if state != running If T is void value must be 0
Definition at line 682 of file future_fwd.hpp.
Trigger the promise with the current value.
Definition at line 717 of file future_fwd.hpp.
Gives access to the underlying value for in-place modification. trigger() must be called after the value is written to trigger the promise.
Definition at line 714 of file future_fwd.hpp.
template<typename T>
template<typename >
template<typename T>
template<typename FT , typename PT >
Feed a promise from a future of possibly different type.
Will monitor f, and bounce its state to p. Error and canceled state are bounced as is. Valued state is bounced through FutureValueConverter<FT, PT>::convert()
Definition at line 621 of file future.hxx.
template<typename T>
template<typename FT , typename PT , typename CONV >
| void adaptFuture |
( |
const Future< FT > & |
f, |
|
|
Promise< PT > & |
p, |
|
|
CONV |
converter |
|
) |
| |
|
friend |
Similar to adaptFuture(f, p) but with a custom converter.
Definition at line 631 of file future.hxx.
template<typename T>
template<typename R >
template<typename T>
template<typename R >
Feed a promise from a generic future which may be unwrapped if it contains itself a future.
Definition at line 610 of file future.hxx.
The documentation for this class was generated from the following file: