BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
PollableDevice.h
1 #pragma once
2 
3 #include <Poco/SharedPtr.h>
4 #include <Poco/Timespan.h>
5 
6 #include "model/DeviceID.h"
7 #include "model/RefreshTime.h"
8 #include "core/Distributor.h"
9 
10 namespace BeeeOn {
11 
19 public:
20  typedef Poco::SharedPtr<PollableDevice> Ptr;
21 
22  virtual ~PollableDevice();
23 
27  virtual DeviceID id() const = 0;
28 
34  virtual RefreshTime refresh() const = 0;
35 
40  virtual void poll(Distributor::Ptr distributor) = 0;
41 };
42 
43 }
RefreshTime represents time of refreshing values from sensors. E.g. sensors are polled periodically o...
Definition: RefreshTime.h:24
virtual RefreshTime refresh() const =0
Regular period telling how often to call the method PollableDevice::poll(). The refresh must contain ...
virtual void poll(Distributor::Ptr distributor)=0
Perform polling for data and ship them via the given distributor.
virtual DeviceID id() const =0
Definition: DeviceID.h:17
PollableDevice is a device that is necessary to poll regularly for data. The polling can take some ti...
Definition: PollableDevice.h:18