Sensor Objects
This includes all the sensor objects including a few
implementations, including dbus and sysfs sensors.
Change-Id: I9897c79f9fd463f00f0e02aeb6c32ffa89635dbe
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/dbus/dbusactiveread.hpp b/dbus/dbusactiveread.hpp
new file mode 100644
index 0000000..a9146b9
--- /dev/null
+++ b/dbus/dbusactiveread.hpp
@@ -0,0 +1,33 @@
+#pragma once
+
+#include <memory>
+#include <string>
+
+#include <sdbusplus/bus.hpp>
+
+#include "interfaces.hpp"
+
+
+/*
+ * This ReadInterface will actively reach out over dbus upon calling read to
+ * get the value from whomever owns the associated dbus path.
+ */
+class DbusActiveRead: public ReadInterface
+{
+ public:
+ DbusActiveRead(sdbusplus::bus::bus& bus,
+ const std::string& path,
+ const std::string& service)
+ : ReadInterface(),
+ _bus(bus),
+ _path(path),
+ _service(service)
+ { }
+
+ ReadReturn read(void) override;
+
+ private:
+ sdbusplus::bus::bus& _bus;
+ const std::string _path;
+ const std::string _service; // the sensor service.
+};