manager: define erase method
The erase method can erase an entry object specified by id.
Change-Id: I86bb2a214b8cf9b951af37f69767ff025f2f5fd0
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/log_manager.cpp b/log_manager.cpp
index e497ae0..11c4392 100644
--- a/log_manager.cpp
+++ b/log_manager.cpp
@@ -178,5 +178,14 @@
}
}
+void Manager::erase(uint32_t entryId)
+{
+ auto entry = entries.find(entryId);
+ if(entries.end() != entry)
+ {
+ entries.erase(entry);
+ }
+}
+
} // namespace logging
} // namepsace phosphor
diff --git a/log_manager.hpp b/log_manager.hpp
index e2a3359..71b6e71 100644
--- a/log_manager.hpp
+++ b/log_manager.hpp
@@ -61,6 +61,12 @@
void commit(uint64_t transactionId, std::string errMsg) override;
+ /** @brief Erase specified entry d-bus object
+ *
+ * @param[in] entryId - unique identifier of the entry
+ */
+ void erase(uint32_t entryId);
+
private:
/** @brief Call metadata handler(s), if any. Handlers may create
* associations.