Activation: Implement ActivationProgress interface

This commit implements the ActivationProgress interface, which maintains
a value representing percentage completion of the activation process.
This value is periodically updated throughout the process.

Resolves openbmc/openbmc#1554

Change-Id: I7dafb32995c4c95d86e1cc17ca42065065eee2f4
Signed-off-by: Michael Tritz <mtritz@us.ibm.com>
diff --git a/activation.hpp b/activation.hpp
index 39e1ea3..4ef2562 100755
--- a/activation.hpp
+++ b/activation.hpp
@@ -5,6 +5,7 @@
 #include <xyz/openbmc_project/Software/ActivationBlocksTransition/server.hpp>
 #include "xyz/openbmc_project/Software/ExtendedVersion/server.hpp"
 #include "xyz/openbmc_project/Software/RedundancyPriority/server.hpp"
+#include "xyz/openbmc_project/Software/ActivationProgress/server.hpp"
 
 namespace openpower
 {
@@ -20,6 +21,8 @@
  sdbusplus::xyz::openbmc_project::Software::server::ActivationBlocksTransition>;
 using RedundancyPriorityInherit = sdbusplus::server::object::object<
     sdbusplus::xyz::openbmc_project::Software::server::RedundancyPriority>;
+using ActivationProgressInherit = sdbusplus::server::object::object<
+    sdbusplus::xyz::openbmc_project::Software::server::ActivationProgress>;
 
 namespace sdbusRule = sdbusplus::bus::match::rules;
 
@@ -92,6 +95,23 @@
                    ActivationBlocksTransitionInherit(bus, path.c_str()) {}
 };
 
+class ActivationProgress : public ActivationProgressInherit
+{
+    public:
+        /** @brief Constructs ActivationProgress.
+         *
+         * @param[in] bus    - The Dbus bus object
+         * @param[in] path   - The Dbus object path
+         */
+        ActivationProgress(sdbusplus::bus::bus& bus,
+                           const std::string& path) :
+                   ActivationProgressInherit(bus, path.c_str(), true)
+       {
+           progress(0);
+           emit_object_added();
+       }
+};
+
 /** @class Activation
  *  @brief OpenBMC activation software management implementation.
  *  @details A concrete implementation for
@@ -190,6 +210,9 @@
         /** @brief Persistent ActivationBlocksTransition dbus object */
         std::unique_ptr<ActivationBlocksTransition> activationBlocksTransition;
 
+        /** @brief Persistent ActivationProgress dbus object */
+        std::unique_ptr<ActivationProgress> activationProgress;
+
         /** @brief Persistent RedundancyPriority dbus object */
         std::unique_ptr<RedundancyPriority> redundancyPriority;