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

Adapter of Poco::Thread to AsyncWork interface. The Thread has no general way how to be stopped and thus the cancel() method is implemented as a blocking join(). More...

#include <ThreadWrapperAsyncWork.h>

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

Public Types

typedef Poco::SharedPtr
< ThreadWrapperAsyncWork
< 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

 ThreadWrapperAsyncWork (Poco::Thread &thread)
 
bool tryJoin (const Poco::Timespan &timeout) override
 
void cancel () override
 Cancel the operation this object represents. It should exit immediatelly or at least as soon as possible.
 
Poco::Thread & thread ()
 
- 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...
 

Detailed Description

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

Adapter of Poco::Thread to AsyncWork interface. The Thread has no general way how to be stopped and thus the cancel() method is implemented as a blocking join().

Member Function Documentation

template<typename Result >
bool BeeeOn::ThreadWrapperAsyncWork< Result >::tryJoin ( const Poco::Timespan &  timeout)
overridevirtual
Returns
true when the time discovery process finishes, false when the timeout has exceeded

Implements BeeeOn::AnyAsyncWork.


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