BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions | Static Public Member Functions
BeeeOn::BlockingAsyncWork< Result > Class Template Reference

BlockingAsyncWork is an adapter of non-asynchronous operations to the AsyncWork interface. It implements a time barrier that just waits until the underlying operation finishes. More...

#include <BlockingAsyncWork.h>

Inheritance diagram for BeeeOn::BlockingAsyncWork< Result >:
BeeeOn::AbstractAsyncWork< Result > BeeeOn::AsyncWork< Result > BeeeOn::AnyAsyncWork BeeeOn::Cancellable

Public Types

typedef Poco::SharedPtr
< BlockingAsyncWork< Result > > 
Ptr
 
- Public Types inherited from BeeeOn::AbstractAsyncWork< Result >
typedef Poco::SharedPtr
< AbstractAsyncWork< Result > > 
Ptr
 
- Public Types inherited from BeeeOn::AsyncWork< Result >
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

bool tryJoin (const Poco::Timespan &) override
 It immediately returns true because there is nothing to wait for. We are already finished when this method can be called.
 
void cancel () override
 Do nothing because the underlying operation is already finished at the time we can call this method.
 
template<>
BlockingAsyncWork< Poco::Void >
::Ptr 
instance ()
 
- Public Member Functions inherited from BeeeOn::AbstractAsyncWork< Result >
void setResult (const Result &result)
 Set result of the operation. The result can be set only once.
 
Poco::Nullable< Resultresult () const override
 
template<>
void setResult (const Poco::Void &)
 
template<>
Poco::Nullable< Poco::Void > 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...
 

Static Public Member Functions

static BlockingAsyncWork
< Result >::Ptr 
instance ()
 BlockingAsyncWork does not have to be created everytime it is needed because it does not contain any state. More...
 

Detailed Description

template<typename Result = Poco::Void>
class BeeeOn::BlockingAsyncWork< Result >

BlockingAsyncWork is an adapter of non-asynchronous operations to the AsyncWork interface. It implements a time barrier that just waits until the underlying operation finishes.

Member Function Documentation

template<typename Result >
BlockingAsyncWork< Result >::Ptr BeeeOn::BlockingAsyncWork< Result >::instance ( )
inlinestatic

BlockingAsyncWork does not have to be created everytime it is needed because it does not contain any state.

Returns
global singleton of BlockingAsyncWork

The documentation for this class was generated from the following file: