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
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 @@
      * @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 @@
     }
 
     /**
+     * @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 @@
      * @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