1 #pragma once 2 3 #include "interfaces.hpp" 4 #include "util.hpp" 5 6 #include <memory> 7 #include <sdbusplus/bus.hpp> 8 #include <string> 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, const std::string& path, 18 const std::string& service, DbusHelperInterface* helper) : 19 ReadInterface(), 20 _bus(bus), _path(path), _service(service), _helper(helper) 21 { 22 } 23 24 ReadReturn read(void) override; 25 26 private: 27 sdbusplus::bus::bus& _bus; 28 const std::string _path; 29 const std::string _service; // the sensor service. 30 DbusHelperInterface* _helper; 31 }; 32