|
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 21 of file future.hpp.
| using yaclib::FutureBase< V, T >::Core = detail::UniqueCore<V, T> |
Definition at line 192 of file future.hpp.
| using yaclib::FutureBase< V, T >::Handle = detail::UniqueHandle |
Definition at line 191 of file future.hpp.
| using yaclib::FutureBase< V, T >::Result = typename T::template Result<V> |
Definition at line 27 of file future.hpp.
|
delete |
|
defaultnoexcept |
|
default |
|
inlinenoexcept |
If Future is Valid then call Stop.
Definition at line 47 of file future.hpp.
|
inlineexplicitprotectednoexcept |
Definition at line 199 of file future.hpp.
|
inlinenoexcept |
Disable calling Stop in destructor.
Definition at line 147 of file future.hpp.
References 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 175 of file future.hpp.
References 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 161 of file future.hpp.
References yaclib::MakeContract().
|
inlinenoexcept |
Definition at line 97 of file future.hpp.
References 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 84 of file future.hpp.
|
inlinenoexcept |
Method that get internal Core state.
Definition at line 187 of file future.hpp.
|
inlinenoexcept |
Definition at line 194 of file future.hpp.
|
delete |
|
defaultnoexcept |
|
inlinenoexcept |
Check that Result that corresponds to this Future is computed.
Definition at line 67 of file future.hpp.
References YACLIB_ASSERT.
|
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 137 of file future.hpp.
References yaclib::IExecutor::Inline, yaclib::MakeContract(), and YACLIB_WARN.
|
inlinenoexcept |
Definition at line 121 of file future.hpp.
References YACLIB_ASSERT.
|
delete |
|
delete |
|
inlinenoexcept |
Definition at line 110 of file future.hpp.
References YACLIB_ASSERT.
|
inlinenoexcept |
Check if this Future has Promise.
Definition at line 58 of file future.hpp.
Referenced by TEST().
|
protected |
Definition at line 202 of file future.hpp.