Make hwmon work with double or int64 interface

Deduce type based on interface using decltype
and if it is double apply scale to the value.

Tested-by: Noticed that on dbus using busctl and debug
server that doubles were produced and scaled.

Also verifed that hwmon still produced int64_t values when
building with current phosphor-dbus-interfaces.

Change-Id: I00e21d5ef0ea6cee0eb30baa0b39cde95e7f4a86
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/interface.hpp b/interface.hpp
index e8ec28e..4b157dc 100644
--- a/interface.hpp
+++ b/interface.hpp
@@ -29,6 +29,11 @@
     server::OperationalStatus;
 using StatusObject = ServerObject<StatusInterface>;
 
+// I understand this seems like magic, but since decltype doesn't evaluate you
+// can call nullptr https://stackoverflow.com/a/5580411/2784885
+using SensorValueType =
+    decltype((static_cast<ValueInterface*>(nullptr))->value());
+
 enum class InterfaceType
 {
     VALUE,