Persist error d-bus objects

Use Cereal to implement serialization and de-serialization of
properties of error d-bus objects.

Serialize and persist error d-bus objects as they are put on the bus.
De-serialize and restore them (if persistent ones exist) when
phosphor-log-manager starts up.

Change-Id: I1f5df1abbe74bfdb86e3e82a78ff7115e90e2112
Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
diff --git a/elog_entry.hpp b/elog_entry.hpp
index 06f6bc2..ffff8af 100644
--- a/elog_entry.hpp
+++ b/elog_entry.hpp
@@ -75,6 +75,24 @@
             this->emit_object_added();
         };
 
+        /** @brief Constructor that puts an "empty" error object on the bus,
+         *         with only the id property populated. Rest of the properties
+         *         to be set by the caller. Caller should emit the added signal.
+         *  @param[in] bus - Bus to attach to.
+         *  @param[in] path - Path to attach at.
+         *  @param[in] id - The error entry id.
+         *  @param[in] parent - The error's parent.
+         */
+        Entry(sdbusplus::bus::bus& bus,
+              const std::string& path,
+              uint32_t entryId,
+              Manager& parent) :
+              EntryIfaces(bus, path.c_str(), true),
+              parent(parent)
+        {
+            id(entryId);
+        };
+
         /** @brief Set resolution status of the error.
          *  @param[in] value - boolean indicating resolution
          *  status (true = resolved)
@@ -89,6 +107,8 @@
             return sdbusplus::xyz::openbmc_project::
                    Logging::server::Entry::resolved(value);
         }
+        using sdbusplus::xyz::openbmc_project::
+              Logging::server::Entry::resolved;
 
         /** @brief Delete this d-bus object.
          */