1 #pragma once
2 
3 #include "interfaces.hpp"
4 #include "util.hpp"
5 
6 #include <sdbusplus/bus.hpp>
7 
8 #include <memory>
9 #include <string>
10 
11 /*
12  * This ReadInterface will actively reach out over dbus upon calling read to
13  * get the value from whomever owns the associated dbus path.
14  */
15 class DbusActiveRead : public ReadInterface
16 {
17   public:
18     DbusActiveRead(sdbusplus::bus::bus& bus, const std::string& path,
19                    const std::string& service, DbusHelperInterface* helper) :
20         ReadInterface(),
21         _bus(bus), _path(path), _service(service), _helper(helper)
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