control: Update config loading

Change the method used to load objects' JSON configuration where a list
of arguments specific to the object's class is given. This allows each
class to be constructed with its specific set of required arguments.
With this change, the zones require a pointer to their manager object
along with a reference to the event loop for their increment and
decrement timers. The manager object stores the cache for all zones,
each zone needs a pointer to its manager to be able to provide access
to that cache.

With the change in how the objects are created from their JSON
configuration files, loading the information into the YAML based
ZoneDefinitions structure is no longer needed.

Change-Id: I4f70cbeb3a708b985ca01a1f3df14ad78da053fb
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/control/json/manager.hpp b/control/json/manager.hpp
index c2a0904..506c8c0 100644
--- a/control/json/manager.hpp
+++ b/control/json/manager.hpp
@@ -122,16 +122,16 @@
      * @brief Load the configuration of a given JSON class object based on the
      * active profiles
      *
-     * @param[in] bus - The sdbusplus bus object
      * @param[in] isOptional - JSON configuration file is optional or not
-     *                         Defaults to false
+     * @param[in] bus - The sdbusplus bus object
+     * @param[in] args - Arguments to be forwarded to each instance of `T`
      *
      * @return Map of configuration entries
      *     Map of configuration keys to their corresponding configuration object
      */
-    template <typename T>
+    template <typename T, typename... Args>
     static std::map<configKey, std::unique_ptr<T>>
-        getConfig(sdbusplus::bus::bus& bus, bool isOptional = false)
+        getConfig(bool isOptional, sdbusplus::bus::bus& bus, Args&&... args)
     {
         std::map<configKey, std::unique_ptr<T>> config;
 
@@ -163,7 +163,8 @@
                         continue;
                     }
                 }
-                auto obj = std::make_unique<T>(bus, entry);
+                auto obj =
+                    std::make_unique<T>(entry, std::forward<Args>(args)...);
                 config.emplace(
                     std::make_pair(obj->getName(), obj->getProfiles()),
                     std::move(obj));