|
YACLib
C++ library for concurrent tasks execution
|
Provides a mechanism to access the result of async operations. More...
#include <future.hpp>
Public Types | |
| using | Result = typename T::template Result< V > |
| using | Handle = detail::UniqueHandle |
| using | Core = detail::UniqueCore< V, T > |
Protected Member Functions | |
| FutureBase (detail::UniqueCorePtr< V, T > core) noexcept | |
Protected Attributes | |
| detail::UniqueCorePtr< V, T > | _core |
Provides a mechanism to access the result of async operations.
Future and Promise are like a Single Producer/Single Consumer one-shot one-element channel. Use the Promise to fulfill the Future.
Definition at line 20 of file future.hpp.
| using yaclib::FutureBase< V, T >::Core = detail::UniqueCore<V, T> |
Definition at line 191 of file future.hpp.
| using yaclib::FutureBase< V, T >::Handle = detail::UniqueHandle |
Definition at line 190 of file future.hpp.
| using yaclib::FutureBase< V, T >::Result = typename T::template Result<V> |
Definition at line 26 of file future.hpp.
|
delete |
|
defaultnoexcept |
|
default |
|
inlinenoexcept |
If Future is Valid then call Stop.
Definition at line 46 of file future.hpp.
References yaclib::FutureBase< V, T >::Valid().
|
inlineexplicitprotectednoexcept |
Definition at line 198 of file future.hpp.
|
inlinenoexcept |
Disable calling Stop in destructor.
Definition at line 146 of file future.hpp.
References yaclib::FutureBase< V, T >::_core, and yaclib::detail::MakeDrop().
|
inline |
Attach the final continuation func to *this and Detach *this.
The func will be executed on the specified executor.
| e | Executor which will Execute the continuation |
| f | A continuation to be attached |
Definition at line 174 of file future.hpp.
References yaclib::FutureBase< V, T >::_core, yaclib::IExecutor::Inline, yaclib::MakeContract(), and YACLIB_WARN.
|
inline |
Attach the final continuation func to *this and Detach *this.
The func will be executed on Inline executor.
| f | A continuation to be attached |
Definition at line 160 of file future.hpp.
References yaclib::FutureBase< V, T >::_core, and yaclib::MakeContract().
|
inlinenoexcept |
Definition at line 96 of file future.hpp.
References yaclib::FutureBase< V, T >::_core, and yaclib::Wait().
|
delete |
|
delete |
|
inlinenoexcept |
Return copy of Result from Future.
If Ready is false return an empty Result. This method is thread-safe and can be called multiple times.
Definition at line 83 of file future.hpp.
References yaclib::FutureBase< V, T >::_core, and yaclib::FutureBase< V, T >::Ready().
|
inlinenoexcept |
Method that get internal Core state.
Definition at line 186 of file future.hpp.
References yaclib::FutureBase< V, T >::_core.
|
inlinenoexcept |
Definition at line 193 of file future.hpp.
References yaclib::FutureBase< V, T >::_core.
|
delete |
|
defaultnoexcept |
|
inlinenoexcept |
Check that Result that corresponds to this Future is computed.
Definition at line 66 of file future.hpp.
References yaclib::FutureBase< V, T >::_core, yaclib::FutureBase< V, T >::Valid(), and YACLIB_ASSERT.
Referenced by yaclib::FutureBase< V, T >::Get(), yaclib::FutureBase< V, T >::Touch(), and yaclib::FutureBase< V, T >::Touch().
|
inline |
Attach the continuation func to *this.
The func will be executed on the specified executor.
| e | Executor which will Execute the continuation |
| f | A continuation to be attached |
Definition at line 136 of file future.hpp.
References yaclib::FutureBase< V, T >::_core, yaclib::IExecutor::Inline, yaclib::MakeContract(), and YACLIB_WARN.
|
inlinenoexcept |
Definition at line 120 of file future.hpp.
References yaclib::FutureBase< V, T >::_core, yaclib::FutureBase< V, T >::Ready(), and YACLIB_ASSERT.
|
delete |
|
delete |
|
inlinenoexcept |
Definition at line 109 of file future.hpp.
References yaclib::FutureBase< V, T >::_core, yaclib::FutureBase< V, T >::Ready(), and YACLIB_ASSERT.
|
inlinenoexcept |
Check if this Future has Promise.
Definition at line 57 of file future.hpp.
References yaclib::FutureBase< V, T >::_core.
Referenced by yaclib::FutureBase< V, T >::Ready(), TEST(), and yaclib::FutureBase< V, T >::~FutureBase().
|
protected |
Definition at line 201 of file future.hpp.
Referenced by yaclib::FutureBase< V, T >::Detach(), yaclib::FutureBase< V, T >::Detach(), yaclib::FutureBase< V, T >::DetachInline(), yaclib::FutureBase< V, T >::Get(), yaclib::FutureBase< V, T >::Get(), yaclib::FutureBase< V, T >::GetCore(), yaclib::FutureBase< V, T >::GetHandle(), yaclib::FutureBase< V, T >::Ready(), yaclib::FutureBase< V, T >::Then(), yaclib::FutureBase< V, T >::Touch(), yaclib::FutureBase< V, T >::Touch(), and yaclib::FutureBase< V, T >::Valid().