monitor:JSON: Parse trust groups

Parse and create the list of trust groups functions from a JSON
configuration file.

Tested:
    Existing trust groups functions parsed and function correctly
    Any required parameters missing cause a runtime exception

Change-Id: I4d24b97c966c97f3ff253d8c96cb0724eff1a8af
Signed-off-by: Matthew Barth <msbarth@us.ibm.com>
diff --git a/monitor/json_parser.hpp b/monitor/json_parser.hpp
index d632d1b..f8d1f4a 100644
--- a/monitor/json_parser.hpp
+++ b/monitor/json_parser.hpp
@@ -16,6 +16,8 @@
 #pragma once
 
 #include "json_config.hpp"
+#include "trust_group.hpp"
+#include "types.hpp"
 
 #include <nlohmann/json.hpp>
 #include <sdbusplus/bus.hpp>
@@ -28,6 +30,10 @@
 constexpr auto confAppName = "monitor";
 constexpr auto confFileName = "config.json";
 
+// Trust group class handler function
+using trustHandler = std::function<CreateGroupFunction(
+    const std::vector<trust::GroupDefinition>&)>;
+
 /**
  * @brief Get the JSON object
  *
@@ -42,4 +48,13 @@
         fan::JsonConfig::getConfFile(bus, confAppName, confFileName));
 }
 
+/**
+ * @brief Get any configured trust groups
+ *
+ * @param[in] obj - JSON object to parse from
+ *
+ * @return List of functions applied on trust groups
+ */
+const std::vector<CreateGroupFunction> getTrustGrps(const json& obj);
+
 } // namespace phosphor::fan::monitor