Implement Trigger Actions

Now action is triggered when threshold is crossed. There are 3
actions: write message to journal, write message to journal as
Redfish Event and update an existing Report.
To update an existing Report updateReading method is changed to
public. Added UpdateReport to ReportManager, now object is able
to update readings of any report using report name.

Tested:
 - Unit tests passed
 - Verified that logs are propagated to journal when threshold
   is crossed

Change-Id: Iebca7c8b9ab9b50b4c401877ccf8c2f01f1e6f36
Signed-off-by: Wludzik, Jozef <jozef.wludzik@intel.com>
diff --git a/src/interfaces/trigger_types.hpp b/src/interfaces/trigger_types.hpp
index ef61aa6..eb0f7c4 100644
--- a/src/interfaces/trigger_types.hpp
+++ b/src/interfaces/trigger_types.hpp
@@ -1,10 +1,11 @@
 #pragma once
 
-#include <sdbusplus/message/types.hpp>
+#include "utils/conversion.hpp"
 
 #include <string>
 #include <tuple>
 #include <utility>
+#include <variant>
 #include <vector>
 
 namespace discrete
@@ -17,6 +18,11 @@
     critical
 };
 
+inline Severity toSeverity(int x)
+{
+    return utils::toEnum<Severity, Severity::ok, Severity::critical>(x);
+}
+
 using ThresholdParam = std::tuple<std::string, std::underlying_type_t<Severity>,
                                   std::variant<double>, uint64_t>;
 } // namespace discrete
@@ -39,6 +45,17 @@
     increasing
 };
 
+inline Type toType(int x)
+{
+    return utils::toEnum<Type, Type::lowerCritical, Type::upperCritical>(x);
+}
+
+inline Direction toDirection(int x)
+{
+    return utils::toEnum<Direction, Direction::either, Direction::increasing>(
+        x);
+}
+
 using ThresholdParam = std::tuple<std::underlying_type_t<Type>, uint64_t,
                                   std::underlying_type_t<Direction>, double>;
 } // namespace numeric