BeeeOn Gateway
v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
|
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>
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) |
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.
Timespan AbstractSeeker::duration | ( | ) | const |
Timespan AbstractSeeker::elapsed | ( | ) | const |
Timespan AbstractSeeker::remaining | ( | ) | const |
Compute time that is remaining to finish the seeking process. If the seeking has finished, it returns 0.
void AbstractSeeker::start | ( | ) |
Start the seeking thread.
Poco::IllegalStateException | in case the seeker was already started. |