Wludzik, Jozef | 76833cb | 2020-12-21 14:42:41 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include <sdbusplus/message/types.hpp> |
| 4 | |
| 5 | #include <string> |
| 6 | #include <tuple> |
| 7 | #include <utility> |
| 8 | #include <vector> |
| 9 | |
| 10 | namespace discrete |
| 11 | { |
| 12 | |
| 13 | enum class Severity |
| 14 | { |
| 15 | ok = 0, |
| 16 | warning, |
| 17 | critical |
| 18 | }; |
| 19 | |
| 20 | using ThresholdParam = std::tuple<std::string, std::underlying_type_t<Severity>, |
| 21 | std::variant<double>, uint64_t>; |
| 22 | } // namespace discrete |
| 23 | |
| 24 | namespace numeric |
| 25 | { |
| 26 | |
| 27 | enum class Type |
| 28 | { |
| 29 | lowerCritical = 0, |
| 30 | lowerWarning, |
| 31 | upperWarning, |
| 32 | upperCritical |
| 33 | }; |
| 34 | |
| 35 | enum class Direction |
| 36 | { |
| 37 | either = 0, |
| 38 | decreasing, |
| 39 | increasing |
| 40 | }; |
| 41 | |
| 42 | using ThresholdParam = std::tuple<std::underlying_type_t<Type>, uint64_t, |
| 43 | std::underlying_type_t<Direction>, double>; |
| 44 | } // namespace numeric |
| 45 | |
| 46 | using TriggerThresholdParams = |
| 47 | std::variant<std::vector<numeric::ThresholdParam>, |
| 48 | std::vector<discrete::ThresholdParam>>; |