regulators: Implements support for rail
Enhance the configuration file parser to support the rail element.
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: Id10809cac4271295c5eb3bd318be775e1d470286
diff --git a/phosphor-regulators/src/config_file_parser.hpp b/phosphor-regulators/src/config_file_parser.hpp
index 251f236..66c4c93 100644
--- a/phosphor-regulators/src/config_file_parser.hpp
+++ b/phosphor-regulators/src/config_file_parser.hpp
@@ -28,6 +28,7 @@
#include "rail.hpp"
#include "rule.hpp"
#include "run_rule_action.hpp"
+#include "sensor_monitoring.hpp"
#include <nlohmann/json.hpp>
@@ -397,6 +398,18 @@
parsePMBusWriteVoutCommand(const nlohmann::json& element);
/**
+ * Parses a JSON element containing a rail.
+ *
+ * Returns the corresponding C++ Rail object.
+ *
+ * Throws an exception if parsing fails.
+ *
+ * @param element JSON element
+ * @return Rail object
+ */
+std::unique_ptr<Rail> parseRail(const nlohmann::json& element);
+
+/**
* Parses a JSON element containing an array of rails.
*
* Returns the corresponding C++ Rail objects.
@@ -480,6 +493,19 @@
std::unique_ptr<RunRuleAction> parseRunRule(const nlohmann::json& element);
/**
+ * Parses a JSON element containing a sensor monitoring operation.
+ *
+ * Returns the corresponding C++ SensorMonitoring object.
+ *
+ * Throws an exception if parsing fails.
+ *
+ * @param element JSON element
+ * @return SensorMonitoring object
+ */
+std::unique_ptr<SensorMonitoring>
+ parseSensorMonitoring(const nlohmann::json& element);
+
+/**
* Parses a JSON element containing a string.
*
* Returns the corresponding C++ string.