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

AbstractAsyncWork provides a generic implementation of method result() and a supplementary method setResult(). The specialization for Poco::Void does not allow to set anything and throws exceptions. The result can be set only once. More...

#include <AbstractAsyncWork.h>

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

Public Types

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

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...
 
- 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.
 

Detailed Description

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

AbstractAsyncWork provides a generic implementation of method result() and a supplementary method setResult(). The specialization for Poco::Void does not allow to set anything and throws exceptions. The result can be set only once.

Member Function Documentation

template<typename Result >
Poco::Nullable< Result > BeeeOn::AbstractAsyncWork< Result >::result ( ) const
inlineoverridevirtual
Returns
null or the result of the operation

Reimplemented from BeeeOn::AsyncWork< Result >.

template<>
Poco::Nullable< Poco::Void > BeeeOn::AbstractAsyncWork< Poco::Void >::result ( ) const
inlinevirtual

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.

Returns
result of the asynchronous operation if any

Reimplemented from BeeeOn::AsyncWork< Result >.


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