blob: a9146b9305cc3307c9fe69895569ddd295aa4125 [file] [log] [blame]
Patrick Venture863b9242018-03-08 08:29:23 -08001#pragma once
2
3#include <memory>
4#include <string>
5
6#include <sdbusplus/bus.hpp>
7
8#include "interfaces.hpp"
9
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 */
15class DbusActiveRead: public ReadInterface
16{
17 public:
18 DbusActiveRead(sdbusplus::bus::bus& bus,
19 const std::string& path,
20 const std::string& service)
21 : ReadInterface(),
22 _bus(bus),
23 _path(path),
24 _service(service)
25 { }
26
27 ReadReturn read(void) override;
28
29 private:
30 sdbusplus::bus::bus& _bus;
31 const std::string _path;
32 const std::string _service; // the sensor service.
33};