summaryrefslogtreecommitdiffstats
path: root/extensions/openpower-pels/manager.hpp
diff options
context:
space:
mode:
authorMatt Spinler <spinler@us.ibm.com>2019-12-11 13:47:50 -0600
committerMatt Spinler <spinler@us.ibm.com>2020-01-27 08:06:26 -0600
commitf60ac27e3ee4aa7166065db93a3fc0ae2d9481ac (patch)
tree5c293bb43577cac4458a3a7a4e39b3fb6084ceab /extensions/openpower-pels/manager.hpp
parent99196688997f16d1611229e007a443d7e1a9f760 (diff)
downloadphosphor-logging-f60ac27e3ee4aa7166065db93a3fc0ae2d9481ac.tar.gz
phosphor-logging-f60ac27e3ee4aa7166065db93a3fc0ae2d9481ac.zip
PEL: Add HostNotifier class
This class will watch for new PELs being created, and handle sending them up to the host. This first commit for this class mostly just fills in the constructor to set up the various callbacks it will use. It is only instantiated in the Manager class if the Manager constructor used is the one that passes in the HostInterface object, to allow for configurations that don't need PELs passed up. Signed-off-by: Matt Spinler <spinler@us.ibm.com> Change-Id: I0ddcf94d047979eb78209d396c2351566c634dbe
Diffstat (limited to 'extensions/openpower-pels/manager.hpp')
-rw-r--r--extensions/openpower-pels/manager.hpp28
1 files changed, 26 insertions, 2 deletions
diff --git a/extensions/openpower-pels/manager.hpp b/extensions/openpower-pels/manager.hpp
index 5f092f4..731dd16 100644
--- a/extensions/openpower-pels/manager.hpp
+++ b/extensions/openpower-pels/manager.hpp
@@ -1,6 +1,7 @@
#pragma once
#include "data_interface.hpp"
+#include "host_notifier.hpp"
#include "log_manager.hpp"
#include "paths.hpp"
#include "registry.hpp"
@@ -28,9 +29,10 @@ class Manager
* @brief constructor
*
* @param[in] logManager - internal::Manager object
+ * @param[in] dataIface - The data interface object
*/
- explicit Manager(phosphor::logging::internal::Manager& logManager,
- std::unique_ptr<DataInterfaceBase>&& dataIface) :
+ Manager(phosphor::logging::internal::Manager& logManager,
+ std::unique_ptr<DataInterfaceBase> dataIface) :
_logManager(logManager),
_repo(getPELRepoPath()),
_registry(getMessageRegistryPath() / message::registryFileName),
@@ -39,6 +41,22 @@ class Manager
}
/**
+ * @brief constructor that enables host notification
+ *
+ * @param[in] logManager - internal::Manager object
+ * @param[in] dataIface - The data interface object
+ * @param[in] hostIface - The hostInterface object
+ */
+ Manager(phosphor::logging::internal::Manager& logManager,
+ std::unique_ptr<DataInterfaceBase> dataIface,
+ std::unique_ptr<HostInterface> hostIface) :
+ Manager(logManager, std::move(dataIface))
+ {
+ _hostNotifier = std::make_unique<HostNotifier>(
+ _repo, *(_dataIface.get()), std::move(hostIface));
+ }
+
+ /**
* @brief Creates a PEL based on the OpenBMC event log contents. If
* a PEL was passed in via the RAWPEL specifier in the
* additionalData parameter, use that instead.
@@ -117,6 +135,12 @@ class Manager
* @brief The API the PEL sections use to gather data
*/
std::unique_ptr<DataInterfaceBase> _dataIface;
+
+ /**
+ * @brief The HostNotifier object used for telling the
+ * host about new PELs
+ */
+ std::unique_ptr<HostNotifier> _hostNotifier;
};
} // namespace pels
OpenPOWER on IntegriCloud