Create active association

Create an association between an active image
and the active image's version object.
This change includes code to remove the active
association if the image is deleted.

Change-Id: Id5b2d353d7df05854b035641765e1066d64a3ef5
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/item_updater.hpp b/item_updater.hpp
index a9bc8f4..affbe53 100755
--- a/item_updater.hpp
+++ b/item_updater.hpp
@@ -4,6 +4,7 @@
 #include "activation.hpp"
 #include <xyz/openbmc_project/Common/FactoryReset/server.hpp>
 #include "version.hpp"
+#include "org/openbmc/Associations/server.hpp"
 
 namespace openpower
 {
@@ -13,9 +14,13 @@
 {
 
 using ItemUpdaterInherit = sdbusplus::server::object::object<
-    sdbusplus::xyz::openbmc_project::Common::server::FactoryReset>;
+    sdbusplus::xyz::openbmc_project::Common::server::FactoryReset,
+    sdbusplus::org::openbmc::server::Associations>;
 namespace MatchRules = sdbusplus::bus::match::rules;
 
+using AssociationList =
+        std::vector<std::tuple<std::string, std::string, std::string>>;
+
 /** @class ItemUpdater
  *  @brief Manages the activation of the version items.
  */
@@ -79,6 +84,19 @@
          */
         void freeSpace();
 
+        /** @brief Creates an active association to the
+         *  newly active software image
+         *
+         * @param[in]  path - The path to create the association to.
+         */
+        void createActiveAssociation(std::string path);
+
+        /** @brief Removes an active association to the software image
+         *
+         * @param[in]  path - The path to remove the association from.
+         */
+        void removeActiveAssociation(std::string path);
+
     private:
         /** @brief Callback function for Software.Version match.
          *  @details Creates an Activation dbus object.
@@ -110,6 +128,9 @@
         /** @brief sdbusplus signal match for Software.Version */
         sdbusplus::bus::match_t versionMatch;
 
+        /** @brief This entry's associations */
+        AssociationList assocs = {};
+
         /** @brief Clears read only PNOR partition for
          *  given Activation dbus object
          *