item_updater : Implementing Object.Delete for version
Change-Id: If962dec1da2d2fe925374bb37f89ed23f04c5ab6
Signed-off-by: Leonel Gonzalez <lgonzalez@us.ibm.com>
diff --git a/version.hpp b/version.hpp
index 23bf604..507d4d0 100644
--- a/version.hpp
+++ b/version.hpp
@@ -2,6 +2,7 @@
#include <sdbusplus/bus.hpp>
#include "xyz/openbmc_project/Software/Version/server.hpp"
+#include "xyz/openbmc_project/Object/Delete/server.hpp"
#include "xyz/openbmc_project/Common/FilePath/server.hpp"
namespace openpower
@@ -11,8 +12,11 @@
namespace updater
{
+class ItemUpdater;
+
using VersionInherit = sdbusplus::server::object::object<
sdbusplus::xyz::openbmc_project::Software::server::Version,
+ sdbusplus::xyz::openbmc_project::Object::server::Delete,
sdbusplus::xyz::openbmc_project::Common::server::FilePath>;
/** @class Version
@@ -30,13 +34,16 @@
* @param[in] versionId - The version identifier
* @param[in] versionPurpose - The version purpose
* @param[in] filePath - The image filesystem path
+ * @param[in] parent - The version's parent
*/
Version(sdbusplus::bus::bus& bus,
const std::string& objPath,
const std::string& versionId,
VersionPurpose versionPurpose,
- const std::string& filePath) : VersionInherit(
- bus, (objPath).c_str(), true)
+ const std::string& filePath,
+ ItemUpdater& parent) : VersionInherit(
+ bus, (objPath).c_str(), true),
+ parent(parent)
{
// Set properties.
purpose(versionPurpose);
@@ -68,6 +75,15 @@
* @return The id.
*/
static std::string getId(const std::string& version);
+
+ /** @brief Deletes the d-bus object and removes image.
+ *
+ */
+ void delete_() override;
+
+ private:
+ ItemUpdater& parent;
+
};
} // namespace updater