Entry: Setup constructor
Persist the log manager dbus bus and create a
vector of Entry instances to store the Entry
dbus objects as they get created.
Change-Id: I4add43c4ce6795b6ec6c041e41cd7455d34b3b6b
Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
diff --git a/elog_entry.cpp b/elog_entry.cpp
index d869056..1360887 100644
--- a/elog_entry.cpp
+++ b/elog_entry.cpp
@@ -6,12 +6,6 @@
namespace logging
{
-Entry::Entry(sdbusplus::bus::bus& bus, const char* obj) :
- details::ServerObject<details::EntryIface>(bus, obj)
-{
- // TODO Add logic to populate error log dbus objects that exist on flash
-}
-
// TODO Add interfaces to handle the error log id numbering
} // namespace logging
diff --git a/elog_entry.hpp b/elog_entry.hpp
index 6c0e52e..bd3915c 100644
--- a/elog_entry.hpp
+++ b/elog_entry.hpp
@@ -24,8 +24,7 @@
* @details A concrete implementation for the
* xyz.openbmc_project.Logging.Entry DBus API.
*/
-class Entry final :
- public details::ServerObject<details::EntryIface>
+class Entry : public details::ServerObject<details::EntryIface>
{
public:
Entry() = delete;
@@ -35,11 +34,12 @@
Entry& operator=(Entry&&) = delete;
virtual ~Entry() = default;
- /** @brief Constructor for the Log Entry object
- * @param[in] bus - DBus bus to attach to.
- * @param[in] obj - Object path to attach to.
+ /** @brief Constructor to put object onto bus at a dbus path.
+ * @param[in] bus - Bus to attach to.
+ * @param[in] path - Path to attach at.
*/
- Entry(sdbusplus::bus::bus& bus, const char* obj);
+ Entry(sdbusplus::bus::bus& bus, const char* path) :
+ details::ServerObject<details::EntryIface>(bus, path) {};
};
} // namespace logging
diff --git a/log_manager.hpp b/log_manager.hpp
index 13e38d9..4ad0ced 100644
--- a/log_manager.hpp
+++ b/log_manager.hpp
@@ -1,6 +1,7 @@
#pragma once
#include <sdbusplus/bus.hpp>
+#include "elog_entry.hpp"
#include "xyz/openbmc_project/Logging/Internal/Manager/server.hpp"
namespace phosphor
@@ -38,7 +39,8 @@
* @param[in] path - Path to attach at.
*/
Manager(sdbusplus::bus::bus& bus, const char* path) :
- details::ServerObject<details::ManagerIface>(bus, path) {};
+ details::ServerObject<details::ManagerIface>(bus, path),
+ busLog(bus) {};
/*
* @fn commit()
@@ -51,6 +53,14 @@
* error log to be committed.
*/
void commit(uint64_t transactionId, std::string errMsg) override;
+
+
+ private:
+ /** @brief Persistent sdbusplus DBus bus connection. */
+ sdbusplus::bus::bus& busLog;
+
+ /** @brief Persistent map of Entry dbus objects and their ID */
+ std::map<uint32_t, std::unique_ptr<Entry>> entries;
};
} // namespace logging