1 #pragma once 2 3 #include <memory> 4 #include <sdbusplus/bus.hpp> 5 #include <string> 6 7 #include "dbus/util.hpp" 8 #include "interfaces.hpp" 9 10 /* 11 * This ReadInterface will actively reach out over dbus upon calling read to 12 * get the value from whomever owns the associated dbus path. 13 */ 14 class DbusActiveRead: public ReadInterface 15 { 16 public: 17 DbusActiveRead(sdbusplus::bus::bus& bus, 18 const std::string& path, 19 const std::string& service, 20 DbusHelperInterface *helper) 21 : ReadInterface(), 22 _bus(bus), 23 _path(path), 24 _service(service), 25 _helper(helper) 26 { } 27 28 ReadReturn read(void) override; 29 30 private: 31 sdbusplus::bus::bus& _bus; 32 const std::string _path; 33 const std::string _service; // the sensor service. 34 DbusHelperInterface *_helper; 35 }; 36