control: Provide zones to the events

The event actions need the zone(s) to run the event's configured
action(s) against. The YAML based configs did not support configuring
which zone(s) to run any particular action within an event against.
A follow up commit will package the zone(s) an action should run against
and provide that directly to the action, eliminating the need to store
that for the trigger callbacks.

Change-Id: I1d0de02a61c9a906f932487231b46add92e8b1d5
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/event.hpp b/control/json/event.hpp
index 4806763..4c4d387 100644
--- a/control/json/event.hpp
+++ b/control/json/event.hpp
@@ -76,9 +76,11 @@
      * @param[in] jsonObj - JSON object
      * @param[in] bus - sdbusplus bus object
      * @param[in] groups - Available groups that can be used
+     * @param[in] zones - Reference to the configured zones
      */
     Event(const json& jsonObj, sdbusplus::bus::bus& bus,
-          std::map<configKey, std::unique_ptr<Group>>& groups);
+          std::map<configKey, std::unique_ptr<Group>>& groups,
+          std::map<configKey, std::unique_ptr<Zone>>& zones);
 
     /**
      * @brief Get the precondition
@@ -120,6 +122,9 @@
     /* List of groups associated with the event */
     std::vector<Group> _groups;
 
+    /* Reference to the configured zones */
+    std::map<configKey, std::unique_ptr<Zone>>& _zones;
+
     /* List of actions for this event */
     std::vector<std::unique_ptr<ActionBase>> _actions;
 
@@ -146,6 +151,17 @@
                    std::map<configKey, std::unique_ptr<Group>>& groups);
 
     /**
+     * @brief Parse and set the event's actions(OPTIONAL)
+     *
+     * @param[in] jsonObj - JSON object for the event
+     * @param[in] groups - Available groups that can be used
+     *
+     * Sets the list of actions to perform for the event
+     */
+    void setActions(const json& jsonObj,
+                    std::map<configKey, std::unique_ptr<Group>>& groups);
+
+    /**
      * @brief Parse and set the event's triggers
      *
      * @param[in] jsonObj - JSON object for the event
@@ -153,15 +169,6 @@
      * Sets the list of triggers for the event
      */
     void setTriggers(const json& jsonObj);
-
-    /**
-     * @brief Parse and set the event's actions(OPTIONAL)
-     *
-     * @param[in] jsonObj - JSON object for the event
-     *
-     * Sets the list of actions to perform for the event
-     */
-    void setActions(const json& jsonObj);
 };
 
 } // namespace phosphor::fan::control::json