entry: implement xyz.openbmc_project.Object.Delete

Implement xyz.openbmc_project.Object.Delete to delete an entry object.

Resolves openbmc/openbmc#1327.

Change-Id: I265c26fb9434d0d4cb066fbfa85729782318bd8f
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/elog_entry.cpp b/elog_entry.cpp
index 1360887..07a2854 100644
--- a/elog_entry.cpp
+++ b/elog_entry.cpp
@@ -1,5 +1,5 @@
-#include <cstdio>
 #include "elog_entry.hpp"
+#include "log_manager.hpp"
 
 namespace phosphor
 {
@@ -8,5 +8,10 @@
 
 // TODO Add interfaces to handle the error log id numbering
 
+void Entry::delete_()
+{
+    parent.erase(id());
+}
+
 } // namespace logging
 } // namepsace phosphor
diff --git a/elog_entry.hpp b/elog_entry.hpp
index e23ba76..ac4949a 100644
--- a/elog_entry.hpp
+++ b/elog_entry.hpp
@@ -3,6 +3,7 @@
 #include <sdbusplus/bus.hpp>
 #include <sdbusplus/server/object.hpp>
 #include "xyz/openbmc_project/Logging/Entry/server.hpp"
+#include "xyz/openbmc_project/Object/Delete/server.hpp"
 #include "org/openbmc/Associations/server.hpp"
 
 namespace phosphor
@@ -12,6 +13,7 @@
 
 using EntryIfaces = sdbusplus::server::object::object<
     sdbusplus::xyz::openbmc_project::Logging::server::Entry,
+    sdbusplus::xyz::openbmc_project::Object::server::Delete,
     sdbusplus::org::openbmc::server::Associations>;
 
 using AssociationList =
@@ -83,6 +85,10 @@
                    Logging::server::Entry::resolved(value);
         }
 
+        /** @brief Delete this d-bus object.
+         */
+        void delete_() override;
+
     private:
         /** @brief This entry's associations */
         AssociationList assocs = {};