YACLib
C++ library for concurrent tasks execution
|
Provides a mechanism to access the result of async operations. More...
#include <future.hpp>
Public Member Functions | |
Future (detail::ResultCorePtr< V, E > core) noexcept | |
template<typename Func > | |
auto | ThenInline (Func &&f) && |
Attach the continuation func to *this. | |
Public Member Functions inherited from yaclib::FutureBase< V, E > | |
FutureBase (const FutureBase &)=delete | |
FutureBase & | operator= (const FutureBase &)=delete |
FutureBase (FutureBase &&other) noexcept=default | |
FutureBase & | operator= (FutureBase &&other) noexcept=default |
FutureBase () noexcept=default | |
The default constructor creates not a Valid Future. | |
~FutureBase () noexcept | |
If Future is Valid then call Stop. | |
bool | Valid () const &noexcept |
Check if this Future has Promise. | |
bool | Ready () const &noexcept |
Check that Result that corresponds to this Future is computed. | |
void | Get () &=delete |
void | Get () const &&=delete |
void | Touch () &=delete |
void | Touch () const &&=delete |
const Result< V, E > * | Get () const &noexcept |
Return copy of Result from Future. | |
Result< V, E > | Get () &&noexcept |
const Result< V, E > & | Touch () const &noexcept |
Result< V, E > | Touch () &&noexcept |
template<typename Func > | |
auto | Then (IExecutor &e, Func &&f) && |
Attach the continuation func to *this. | |
void | Detach () &&noexcept |
Disable calling Stop in destructor. | |
template<typename Func > | |
void | DetachInline (Func &&f) && |
Attach the final continuation func to *this and Detach *this. | |
template<typename Func > | |
void | Detach (IExecutor &e, Func &&f) && |
Attach the final continuation func to *this and Detach *this. | |
detail::ResultCorePtr< V, E > & | GetCore () noexcept |
Method that get internal Core state. | |
Additional Inherited Members | |
Protected Member Functions inherited from yaclib::FutureBase< V, E > | |
FutureBase (detail::ResultCorePtr< V, E > core) noexcept | |
Protected Attributes inherited from yaclib::FutureBase< V, E > | |
detail::ResultCorePtr< V, E > | _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 199 of file future.hpp.
|
inlinenoexcept |
Definition at line 205 of file future.hpp.
References yaclib::MakeContract().
|
inline |
Attach the continuation func to *this.
The func will be executed on Inline executor.
f | A continuation to be attached |
Definition at line 217 of file future.hpp.
References yaclib::MakeContract().