|
libqi-api
2.4.3.28
|
#include <executioncontext.hpp>
Public Types | |
| typedef detail::FutureType< T > ::type | ValueType |
| typedef detail::FutureType< T > ::typecast | ValueTypeCast |
| typedef boost::function< void(Future < T >) > | Connection |
Public Member Functions | |
| Future () | |
| Future (const Future< T > &b) | |
| bool | operator== (const Future< T > &other) |
| Future< T > & | operator= (const Future< T > &b) |
| bool | operator< (const Future< T > &b) const |
| FutureUniqueId | uniqueId () const |
| Future (const ValueType &v, FutureCallbackType async=FutureCallbackType_Async) | |
| const ValueType & | value (int msecs=FutureTimeout_Infinite) const |
| Return the value associated to a Future. More... | |
| operator const ValueTypeCast & () const | |
| FutureState | wait (int msecs=FutureTimeout_Infinite) const |
| FutureState | wait (qi::Duration duration) const |
| FutureState | waitFor (qi::Duration duration) const |
| FutureState | wait (qi::SteadyClock::time_point timepoint) const |
| FutureState | waitUntil (qi::SteadyClock::time_point timepoint) const |
| bool | isFinished () const |
| bool | isRunning () const |
| bool | isCanceled () const |
| bool | hasError (int msecs=FutureTimeout_Infinite) const |
| bool | hasValue (int msecs=FutureTimeout_Infinite) const |
| const std::string & | error (int msecs=FutureTimeout_Infinite) const |
| FutureSync< T > | sync () |
| void | cancel () |
| bool | isCancelable () const |
| template<typename R > | |
| Future< R > | thenR (FutureCallbackType type, const boost::function< R(const Future< T > &)> &func) |
| template<typename R > | |
| Future< R > | thenR (const boost::function< R(const Future< T > &)> &func) |
| template<typename R > | |
| Future< R > | andThenR (FutureCallbackType type, const boost::function< R(const typename Future< T >::ValueType &)> &func) |
| template<typename R > | |
| Future< R > | andThenR (const boost::function< R(const typename Future< T >::ValueType &)> &func) |
| boost::function< void()> | makeCanceler () |
| Get a functor that will cancel the future. More... | |
| template<typename AF > | |
| void | connect (const AF &fun, FutureCallbackType type=FutureCallbackType_Async) |
| template<typename FUNCTYPE , typename ARG0 > | |
| void | connect (FUNCTYPE fun, ARG0 tracked,..., FutureCallbackType type=FutureCallbackType_Async) |
| void | connectWithStrand (qi::Strand *strand, const boost::function< void(const Future< T > &)> &cb) |
| void | _connect (const boost::function< void()> &s) |
| boost::shared_ptr < detail::FutureBaseTyped< T > > | impl () |
| Future (boost::shared_ptr< detail::FutureBaseTyped< T > > p) | |
Protected Attributes | |
| boost::shared_ptr < detail::FutureBaseTyped< T > > | _p |
Friends | |
| class | Promise< T > |
| class | FutureSync< T > |
| class | detail::AddUnwrap< T > |
| class | ServiceBoundObject |
| template<typename R > | |
| void | adaptFutureUnwrap (Future< AnyReference > &f, Promise< R > &p) |
| Feed a promise from a generic future which may be unwrapped if it contains itself a future. More... | |
| template<typename FT , typename PT > | |
| void | adaptFuture (const Future< FT > &f, Promise< PT > &p) |
| Feed a promise from a future of possibly different type. More... | |
| template<typename FT , typename PT , typename CONV > | |
| void | adaptFuture (const Future< FT > &f, Promise< PT > &p, CONV converter) |
| Similar to adaptFuture(f, p) but with a custom converter. More... | |
| template<typename R > | |
| void | adaptFuture (Future< AnyReference > &f, Promise< R > &p) |
| template<typename FT > | |
| void | detail::futureCancelAdapter (boost::weak_ptr< detail::FutureBaseTyped< FT > > wf) |
Class that represents a value that will be set later in time.
Definition at line 18 of file executioncontext.hpp.
| typedef boost::function<void (Future<T>) > qi::Future< T >::Connection |
Definition at line 364 of file future_fwd.hpp.
| typedef detail::FutureType<T>::type qi::Future< T >::ValueType |
Definition at line 145 of file future_fwd.hpp.
| typedef detail::FutureType<T>::typecast qi::Future< T >::ValueTypeCast |
Definition at line 146 of file future_fwd.hpp.
|
inline |
Definition at line 149 of file future_fwd.hpp.
|
inline |
Definition at line 154 of file future_fwd.hpp.
|
inlineexplicit |
Construct a Future that already contains a value.
Definition at line 181 of file future_fwd.hpp.
|
inline |
Definition at line 420 of file future_fwd.hpp.
|
inline |
Definition at line 414 of file future_fwd.hpp.
|
inline |
Definition at line 121 of file future.hxx.
|
inline |
Definition at line 331 of file future_fwd.hpp.
|
inline |
cancel() the asynchronous operation if possible Exact effect is controlled by the cancel implementation, but it is expected to set a value or an error to the Future as fast as possible. Note that cancelation may be asynchronous.
| ExceptionState_FutureNotCancelable | if isCancelable() is false. |
Definition at line 300 of file future_fwd.hpp.
|
inline |
Connect a callback function that will be called once when the Future finishes (that is, switches from running to an other state).
If type is sync, connect may block and call the callback synchronously if the future is already set.
It guaranteed that your callback will be called exactly once (unless the promise is never set or the promise is reset, which is deprecated).
Definition at line 376 of file future_fwd.hpp.
| void qi::Future< T >::connect | ( | FUNCTYPE | fun, |
| ARG0 | tracked, | ||
| ..., | |||
| FutureCallbackType | type = FutureCallbackType_Async |
||
| ) |
Connect a callback with binding and tracking support.
If the first argument is a weak_ptr or a pointer inheriting from qi::Trackable, the callback will not be called if tracked object was destroyed.
|
inline |
Definition at line 404 of file future_fwd.hpp.
|
inline |
| msecs |
Definition at line 283 of file future_fwd.hpp.
|
inline |
| msecs | timeout |
Definition at line 264 of file future_fwd.hpp.
|
inline |
| msecs | timeout |
Definition at line 274 of file future_fwd.hpp.
|
inline |
Definition at line 419 of file future_fwd.hpp.
|
inline |
Definition at line 308 of file future_fwd.hpp.
|
inline |
Definition at line 255 of file future_fwd.hpp.
|
inline |
Definition at line 239 of file future_fwd.hpp.
|
inline |
Definition at line 246 of file future_fwd.hpp.
| boost::function< void()> qi::Future< T >::makeCanceler | ( | ) |
Get a functor that will cancel the future.
This functor will not keep the future alive, which is useful to avoid reference cycles. If the future does not exist anymore, this is a no-op.
Definition at line 230 of file future.hxx.
|
inline |
same as value() with an infinite timeout.
Definition at line 205 of file future_fwd.hpp.
|
inline |
Definition at line 169 of file future_fwd.hpp.
|
inline |
Definition at line 163 of file future_fwd.hpp.
|
inline |
Definition at line 158 of file future_fwd.hpp.
|
inline |
Make the future sync Should not be useful, use wait().
Definition at line 289 of file future_fwd.hpp.
|
inline |
Definition at line 105 of file future.hxx.
|
inline |
Definition at line 319 of file future_fwd.hpp.
|
inline |
Definition at line 174 of file future_fwd.hpp.
|
inline |
Return the value associated to a Future.
| msecs | timeout |
This function can throw for many reason:
if an error is set, then value throw a FutureUserException, others errors are FutureException.
Definition at line 200 of file future_fwd.hpp.
|
inline |
Wait for future to contain a value or an error
| msecs | Maximum time to wait in milliseconds, 0 means return immediately. |
Definition at line 212 of file future_fwd.hpp.
|
inline |
Wait for future to contain a value or an error
| duration | Maximum time to wait |
Definition at line 219 of file future_fwd.hpp.
|
inline |
Wait for future to contain a value or an error
| timepoint | Time until which we can wait |
Definition at line 229 of file future_fwd.hpp.
|
inline |
Definition at line 222 of file future_fwd.hpp.
|
inline |
Definition at line 232 of file future_fwd.hpp.
|
friend |
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.
|
friend |
Similar to adaptFuture(f, p) but with a custom converter.
Definition at line 631 of file future.hxx.
|
friend |
|
friend |
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.
|
friend |
Definition at line 445 of file future_fwd.hpp.
|
friend |
|
friend |
Definition at line 430 of file future_fwd.hpp.
|
friend |
Definition at line 429 of file future_fwd.hpp.
|
friend |
Definition at line 448 of file future_fwd.hpp.
|
protected |
Definition at line 428 of file future_fwd.hpp.