BeeeOn Gateway  v2020.3.1-2-g6f737dc
Platform to interconnect the IoT world
ServerDeviceListResult.h
1 #pragma once
2 
3 #include <map>
4 #include <vector>
5 
6 #include <Poco/Mutex.h>
7 #include <Poco/Nullable.h>
8 
9 #include "core/Answer.h"
10 #include "core/Result.h"
11 #include "model/DeviceID.h"
12 #include "model/ModuleID.h"
13 
14 namespace BeeeOn {
15 
16 /*
17  * The result for ServerDeviceListCommand that includes
18  * device list for the particular Prefix.
19  */
21 public:
22  typedef Poco::AutoPtr<ServerDeviceListResult> Ptr;
23  typedef std::map<ModuleID, double> ModuleValues;
24  typedef std::map<DeviceID, ModuleValues> DeviceValues;
25 
26  ServerDeviceListResult(const Answer::Ptr answer);
27 
28  void setDevices(const DeviceValues &values);
29  DeviceValues devices() const;
30 
31  void setDeviceList(const std::vector<DeviceID> &deviceList);
32  std::vector<DeviceID> deviceList() const;
33 
34  Poco::Nullable<double> value(const DeviceID &id, const ModuleID &module) const;
35 
36 protected:
38 
39 private:
40  DeviceValues m_data;
41 };
42 
43 }
Definition: ServerDeviceListResult.h:20
Definition: ModuleID.h:12
Definition: Result.h:29
Definition: DeviceID.h:17