BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
Public Types | Public Member Functions | Protected Member Functions
BeeeOn::AbstractSeeker Class Referenceabstract

AbstractSeeker represents an asynchronous process that seeks for new devices in a certain network. It is basically a thread that performs some technology-specific routines to discover new devices. More...

#include <AbstractSeeker.h>

Inheritance diagram for BeeeOn::AbstractSeeker:
BeeeOn::AsyncWork<> BeeeOn::Loggable BeeeOn::AnyAsyncWork BeeeOn::Cancellable BeeeOn::BelkinWemoDeviceManager::BelkinWemoSeeker BeeeOn::BLESmartDeviceManager::BLESmartSeeker BeeeOn::PhilipsHueDeviceManager::PhilipsHueSeeker BeeeOn::VektivaDeviceManager::VektivaSeeker BeeeOn::VPTDeviceManager::VPTSeeker

Public Types

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

 AbstractSeeker (const Poco::Timespan &duration)
 
Poco::Timespan duration () const
 
Poco::Timespan elapsed () const
 
Poco::Timespan remaining () const
 Compute time that is remaining to finish the seeking process. If the seeking has finished, it returns 0. More...
 
void start ()
 Start the seeking thread. More...
 
bool tryJoin (const Poco::Timespan &timeout) override
 Join the seeking thread via Joiner.
 
void cancel () override
 Cancel seeking and wait for the thread to finish.
 
- Public Member Functions inherited from BeeeOn::AsyncWork<>
virtual 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...
 

Protected Member Functions

void seek ()
 
virtual void seekLoop (StopControl &control)=0
 
- Protected Member Functions inherited from BeeeOn::Loggable
void setupLogger (Poco::Logger *logger=0) const
 
Poco::Logger & logger () const
 
 Loggable (const ClassInfo &info)
 
 Loggable (const std::type_info &info)
 

Additional Inherited Members

- Static Protected Member Functions inherited from BeeeOn::Loggable
static Poco::Logger & forMethod (const char *name)
 
static Poco::Logger & forClass (const ClassInfo &info)
 
static Poco::Logger & forClass (const std::type_info &info)
 
template<typename T >
static Poco::Logger & forInstance (const T *i)
 
static void configureSimple (Poco::Logger &logger, const std::string &level)
 
static void logException (Poco::Logger &logger, const Poco::Message::Priority priority, const Poco::Exception &e, const char *file, size_t line)
 

Detailed Description

AbstractSeeker represents an asynchronous process that seeks for new devices in a certain network. It is basically a thread that performs some technology-specific routines to discover new devices.

A single AbstractSeeker instance can perform only 1 seek. For every other seek a new AbstractSeeker must be created.

Member Function Documentation

Timespan AbstractSeeker::duration ( ) const
Returns
total duration of seeking
Timespan AbstractSeeker::elapsed ( ) const
Returns
time elapsed while seeking
Timespan AbstractSeeker::remaining ( ) const

Compute time that is remaining to finish the seeking process. If the seeking has finished, it returns 0.

Returns
time remaining to finish of seeking
void AbstractSeeker::start ( )

Start the seeking thread.

Exceptions
Poco::IllegalStateExceptionin case the seeker was already started.

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