item_updater: Added erase method

Implements Object.Delete, so item_updater deletes
ReadWrite, ReadOnly partitions, and removes
Version, and Activation from maps.

Resolves openbmc/openbmc#1550

Change-Id: If6d08bc7d380d043c28a26570e4698201cd7f5b0
Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
diff --git a/version.hpp b/version.hpp
index fcd57eb..ef6747f 100755
--- a/version.hpp
+++ b/version.hpp
@@ -35,14 +35,18 @@
          * @param[in] versionId      - The version identifier
          * @param[in] versionPurpose - The version purpose
          * @param[in] filePath       - The image filesystem path
+         * @param[in] callback       - The parent's erase callback
          */
         Version(sdbusplus::bus::bus& bus,
                 const std::string& objPath,
                 const std::string& versionId,
                 VersionPurpose versionPurpose,
-                const std::string& filePath) : VersionInherit(
+                const std::string& filePath,
+                eraseFunc callback) : VersionInherit(
                     bus, (objPath).c_str(), true)
         {
+            // Bind erase method
+            eraseCallback = callback;
             // Set properties.
             purpose(versionPurpose);
             version(versionId);