summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDeepak Kodihalli <dkodihal@in.ibm.com>2017-04-10 02:11:54 -0500
committerPatrick Williams <patrick@stwcx.xyz>2017-04-11 10:57:48 +0000
commit8110ca6d243bbec89e5ce3be644883bf0dadd23d (patch)
treeb413ab153cc3e9e729612cb9e003b6c2336e9d5f
parent36db46c210bcd8fabb5947a7bc7ca4933486cdad (diff)
downloadphosphor-logging-8110ca6d243bbec89e5ce3be644883bf0dadd23d.tar.gz
phosphor-logging-8110ca6d243bbec89e5ce3be644883bf0dadd23d.zip
entry: store parent reference
Have the entry object store a reference to the error manager, passed via the entry ctor. Change-Id: I2c4a8c4c95929ab7005620f44ac17e9654d8e906 Signed-off-by: Deepak Kodihalli <dkodihal@in.ibm.com>
-rw-r--r--elog_entry.hpp12
-rw-r--r--log_manager.cpp3
2 files changed, 12 insertions, 3 deletions
diff --git a/elog_entry.hpp b/elog_entry.hpp
index ac4949a..06f6bc2 100644
--- a/elog_entry.hpp
+++ b/elog_entry.hpp
@@ -19,6 +19,8 @@ using EntryIfaces = sdbusplus::server::object::object<
using AssociationList =
std::vector<std::tuple<std::string, std::string, std::string>>;
+class Manager;
+
/** @class Entry
* @brief OpenBMC logging entry implementation.
* @details A concrete implementation for the
@@ -45,6 +47,7 @@ class Entry : public EntryIfaces
* @param[in] severityErr - The severity of the error.
* @param[in] msgErr - The message of the error.
* @param[in] additionalDataErr - The error metadata.
+ * @param[in] parent - The error's parent.
*/
Entry(sdbusplus::bus::bus& bus,
const std::string& path,
@@ -53,8 +56,10 @@ class Entry : public EntryIfaces
Level severityErr,
std::string&& msgErr,
std::vector<std::string>&& additionalDataErr,
- AssociationList&& objects) :
- EntryIfaces(bus, path.c_str(), true)
+ AssociationList&& objects,
+ Manager& parent) :
+ EntryIfaces(bus, path.c_str(), true),
+ parent(parent)
{
id(idErr);
severity(severityErr);
@@ -92,6 +97,9 @@ class Entry : public EntryIfaces
private:
/** @brief This entry's associations */
AssociationList assocs = {};
+
+ /** @brief This entry's parent */
+ Manager& parent;
};
} // namespace logging
diff --git a/log_manager.cpp b/log_manager.cpp
index 11c4392..8ab495b 100644
--- a/log_manager.cpp
+++ b/log_manager.cpp
@@ -153,7 +153,8 @@ void Manager::commit(uint64_t transactionId, std::string errMsg)
static_cast<Entry::Level>(reqLevel),
std::move(errMsg),
std::move(additionalData),
- std::move(objects))));
+ std::move(objects),
+ *this)));
return;
}
OpenPOWER on IntegriCloud