Add Average and Maximum classes

These classes will implement the
xyz.openbmc_project.Sensor.Aggregation.History.Average/Maximum
interfaces.   Each of these interfaces contains an array of
value/timestamp entries, where the value is either the average
or maximum power as reported by the power supply.  The most recent
value will always be in element 0 of the array.

Change-Id: I41b0b84abe146c57f23629bd50acbf9e7fb746ab
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/power-supply/average.hpp b/power-supply/average.hpp
new file mode 100644
index 0000000..817f0bf
--- /dev/null
+++ b/power-supply/average.hpp
@@ -0,0 +1,57 @@
+#pragma once
+#include <functional>
+#include <org/open_power/Sensor/Aggregation/History/Average/server.hpp>
+
+namespace witherspoon
+{
+namespace power
+{
+namespace history
+{
+
+template <typename T>
+using ServerObject = typename sdbusplus::server::object::object<T>;
+
+using AverageInterface = sdbusplus::org::open_power::
+        Sensor::Aggregation::History::server::Average;
+
+/**
+ * @class Average
+ *
+ * Implements Sensor.Aggregation.History.Average
+ *
+ * This includes a property that is an array of timestamp/average tuples
+ * and a property to specify the scale.
+ */
+class Average : public ServerObject<AverageInterface>
+{
+    public:
+
+        static constexpr auto name = "average";
+
+        Average() = delete;
+        Average(const Average&) = delete;
+        Average& operator=(const Average&) = delete;
+        Average(Average&&) = delete;
+        Average& operator=(Average&&) = delete;
+        ~Average() = default;
+
+        /**
+         * @brief Constructor
+         *
+         * @param[in] bus - D-Bus object
+         * @param[in] objectPath - the D-Bus object path
+         */
+        Average(sdbusplus::bus::bus& bus,
+                const std::string& objectPath) :
+                ServerObject<AverageInterface>(bus, objectPath.c_str())
+        {
+            unit(Average::Unit::Watts);
+            scale(0);
+        }
+};
+
+
+}
+}
+}