regulators: Implements support for not action
Enhance the configuration file parser to support the not action element.
Signed-off-by: Bob King <Bob_King@wistron.com>
Change-Id: Ia88eee705a9fae28a816aeb6dff9e0b6f0deba39
diff --git a/phosphor-regulators/src/config_file_parser.hpp b/phosphor-regulators/src/config_file_parser.hpp
index d81e403..e2476a2 100644
--- a/phosphor-regulators/src/config_file_parser.hpp
+++ b/phosphor-regulators/src/config_file_parser.hpp
@@ -27,6 +27,7 @@
#include "i2c_write_bit_action.hpp"
#include "i2c_write_byte_action.hpp"
#include "i2c_write_bytes_action.hpp"
+#include "not_action.hpp"
#include "pmbus_write_vout_command_action.hpp"
#include "presence_detection.hpp"
#include "rail.hpp"
@@ -440,6 +441,18 @@
}
/**
+ * Parses a JSON element containing a not action.
+ *
+ * Returns the corresponding C++ NotAction object.
+ *
+ * Throws an exception if parsing fails.
+ *
+ * @param element JSON element
+ * @return NotAction object
+ */
+std::unique_ptr<NotAction> parseNot(const nlohmann::json& element);
+
+/**
* Parses a JSON element containing a pmbus_write_vout_command action.
*
* Returns the corresponding C++ PMBusWriteVoutCommandAction object.