Create pcap object and log monitored events

Change-Id: I2d7b3a449e2c9c1d5a0627161f8e85dcaca1e087
Signed-off-by: Andrew Geissler <andrewg@us.ibm.com>
diff --git a/occ_manager.hpp b/occ_manager.hpp
index a1b5234..48cd9c8 100644
--- a/occ_manager.hpp
+++ b/occ_manager.hpp
@@ -8,6 +8,7 @@
 #include "occ_pass_through.hpp"
 #include "occ_status.hpp"
 #include "config.h"
+#include <powercap.hpp>
 
 namespace sdbusRule = sdbusplus::bus::match::rules;
 
@@ -78,6 +79,14 @@
                 std::make_unique<Status>(
                     bus,
                     path.c_str()));
+
+            // Create the power cap monitor object for master occ (0)
+            if(!pcap && (index == 0))
+            {
+                pcap = std::make_unique<open_power::occ::powercap::PowerCap>(
+                                                        bus,
+                                                        *statusObjects[index]);
+            }
             return 0;
         }
 
@@ -91,6 +100,9 @@
         /** @brief OCC Status objects */
         std::vector<std::unique_ptr<Status>> statusObjects;
 
+        /** @brief Power cap monitor and occ notification object */
+        std::unique_ptr<open_power::occ::powercap::PowerCap> pcap;
+
         /** @brief sbdbusplus match objects */
         std::vector<sdbusplus::bus::match_t> cpuMatches;
 };