PNOR: implement Software RedundancyPriority interface.

- Create override function for redundancepriority.
- Update RedundancyPriority for image that holds that
  already holds the requested priority.

Resolves openbmc/openbmc#1553

Change-Id: I1a5c35826c881f6e9e21550c664b033c6f4b4bc0
Signed-off-by: Saqib Khan <khansa@us.ibm.com>
diff --git a/activation.hpp b/activation.hpp
index bedef81..39e1ea3 100755
--- a/activation.hpp
+++ b/activation.hpp
@@ -23,6 +23,10 @@
 
 namespace sdbusRule = sdbusplus::bus::match::rules;
 
+class ItemUpdater;
+class Activation;
+class RedundancyPriority;
+
 /** @class RedundancyPriority
  *  @brief OpenBMC RedundancyPriority implementation
  *  @details A concrete implementation for
@@ -35,14 +39,19 @@
          *
          *  @param[in] bus    - The Dbus bus object
          *  @param[in] path   - The Dbus object path
+         *  @param[in] parent - Parent object.
+         *  @param[in] value  - The redundancyPriority value
          */
         RedundancyPriority(sdbusplus::bus::bus& bus,
-                                   const std::string& path) :
+                                   const std::string& path,
+                                   Activation& parent,
+                                   uint8_t value) :
                                    RedundancyPriorityInherit(bus,
-                                   path.c_str(), true)
+                                   path.c_str(), true),
+                                   parent(parent)
         {
             // Set Property
-            priority(0);
+            priority(value);
             // Emit deferred signal.
             emit_object_added();
         }
@@ -54,6 +63,15 @@
          *  @return Success or exception thrown
          */
         uint8_t priority(uint8_t value) override;
+
+        /** @brief Priority property get function
+         *
+         * @returns uint8_t - The Priority value
+         */
+        using RedundancyPriorityInherit::priority;
+
+        /** @brief Parent Object. */
+        Activation& parent;
 };
 
 /** @class ActivationBlocksTransition
@@ -86,11 +104,13 @@
          *
          * @param[in] bus    - The Dbus bus object
          * @param[in] path   - The Dbus object path
+         * @param[in] parent - Parent object.
          * @param[in] versionId  - The software version id
          * @param[in] extVersion - The extended version
          * @param[in] activationStatus - The status of Activation
          */
         Activation(sdbusplus::bus::bus& bus, const std::string& path,
+                   ItemUpdater& parent,
                    std::string& versionId,
                    std::string& extVersion,
                    sdbusplus::xyz::openbmc_project::Software::
@@ -98,6 +118,7 @@
                    ActivationInherit(bus, path.c_str(), true),
                    bus(bus),
                    path(path),
+                   parent(parent),
                    versionId(versionId),
                    systemdSignals(
                            bus,
@@ -160,6 +181,9 @@
         /** @brief Persistent DBus object path */
         std::string path;
 
+        /** @brief Parent Object. */
+        ItemUpdater& parent;
+
         /** @brief Version id */
         std::string versionId;