Extension of mel::core::Future to apply to executors.
More...
#include <ExFuture.h>
|
|
typedef _private::FutureData< T >::ValueType | ValueType |
| |
|
|
| ExFuture (const ExFuture &ob) noexcept |
| |
|
| ExFuture (ExFuture &&ob) noexcept |
| |
|
| ExFuture (Executor< ExecutorAgent > aEx) noexcept |
| |
|
| ExFuture (Executor< ExecutorAgent > aEx, const ResultType &val) |
| |
|
| ExFuture (Executor< ExecutorAgent > aEx, ResultType &&val) |
| |
|
ExFuture & | operator= (const ExFuture &f) noexcept |
| |
|
ExFuture & | operator= (ExFuture &&f) noexcept |
| |
|
template<class F > |
| void | setValue (F &&value) |
| |
|
template<class F > |
| void | setError (F &&ei) |
| |
| const _private::FutureData< T >::ValueType & | getValue () const |
| | Get the Value object. More...
|
| |
| _private::FutureData< T >::ValueType & | getValue () |
| | Get the Value object. More...
|
| |
|
void | assign (const typename _private::FutureData< T >::ValueType &val) |
| |
|
void | assign (typename _private::FutureData< T >::ValueType &&val) |
| |
| void | assign (Future_Common< T > val) |
| | Makes this Future to point to the same value as the given Future. More...
|
| |
| template<class F > |
| int | subscribeCallback (F &&f) const |
| | Subscribe callback to be executed when future is ready (valid or error) More...
|
| |
| int | unsubscribeCallback (int id) const |
| | Unsubscribe given callback. More...
|
| |
|
|
Executor< ExecutorAgent > | agent |
| | execution agent associated with this instance
|
| |
template<typename ExecutorAgent, typename ResultType>
class mel::execution::ExFuture< ExecutorAgent, ResultType >
Extension of mel::core::Future to apply to executors.
Any executor function will return an ExFuture, allowing this way to chain functions
◆ assign()
Makes this Future to point to the same value as the given Future.
This ways, both futures will share the same value/error. If input Future is already set at that moment, callbacks are triggered as usual. It's important to note that all futures sharing same data will change
◆ getValue() [1/2]
◆ getValue() [2/2]
◆ subscribeCallback()
template<typename T >
template<class F >
Subscribe callback to be executed when future is ready (valid or error)
- Parameters
-
- Warning
- Usually callback is executed in the context of the thread doing setValue, but if Future is already ready callback will be executed in the context of the thread doing subscription. In general, for this and more reasons, callbacks responses should be done buy launchin a task, so decoupliing totally the diferent tasks
- Returns
- callback id
◆ unsubscribeCallback()
Unsubscribe given callback.
because use of lambda, unsubscription can only be done by id (returned by subscribeCallback)
The documentation for this class was generated from the following file:
- /github/workspace/mel/include/execution/ExFuture.h