Add persistency for events
Persist event D-bus objects using cereal
Resolves openbmc/openbmc#2319
Change-Id: Ifa15d944fe1d1026761f65eeb647dcbdf6afdba0
Signed-off-by: Dhruvaraj Subhashchandran <dhruvaraj@in.ibm.com>
diff --git a/src/event_entry.hpp b/src/event_entry.hpp
index e39f1e2..899e5ec 100644
--- a/src/event_entry.hpp
+++ b/src/event_entry.hpp
@@ -50,6 +50,17 @@
this->emit_object_added();
}
+ /** @brief Constructor to create an empty event object with only
+ * timestamp, caller should make a call to emit added signal.
+ * @param[in] path - Path to attach at.
+ * @param[in] timestamp - timestamp when the event created.
+ */
+ Entry(const std::string& path, uint64_t eventTimestamp) :
+ EntryIface(SDBusPlus::getBus(), path.c_str(), true), objectPath(path)
+ {
+ timestamp(eventTimestamp);
+ }
+
/** @brief Path of Object. */
std::string objectPath;
};