BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
AsyncWork is an interface allowing to wait until an asynchronous operation finishes. It is also possible to force-stop it by calling cancel(). More...
#include <AsyncWork.h>
Public Types | |
typedef Poco::SharedPtr < AsyncWork > | Ptr |
Public Types inherited from BeeeOn::AnyAsyncWork | |
typedef Poco::SharedPtr < AnyAsyncWork > | Ptr |
Public Types inherited from BeeeOn::Cancellable | |
typedef Poco::SharedPtr < Cancellable > | Ptr |
Public Member Functions | |
virtual Poco::Nullable< Result > | result () const |
If the asynchronous operation provides a result, this method gives access to it. Until the operation finishes, the result would be null. AsyncWork implementations with no result returns always null. More... | |
Public Member Functions inherited from BeeeOn::AnyAsyncWork | |
virtual bool | tryJoin (const Poco::Timespan &timeout)=0 |
Public Member Functions inherited from BeeeOn::Cancellable | |
virtual void | cancel ()=0 |
Cancel the operation this object represents. It should exit immediatelly or at least as soon as possible. | |
AsyncWork is an interface allowing to wait until an asynchronous operation finishes. It is also possible to force-stop it by calling cancel().
The AsyncWork can be parametrized to return a result. Access to the result MUST be protected for safe parallel access. The type of the result is based on the template parameter.
|
virtual |
If the asynchronous operation provides a result, this method gives access to it. Until the operation finishes, the result would be null. AsyncWork implementations with no result returns always null.
Reimplemented in BeeeOn::AbstractAsyncWork< Result >, BeeeOn::AbstractAsyncWork< Result >, and BeeeOn::AbstractAsyncWork< std::set< BeeeOn::DeviceID > >.