Using enum class instead of string in more places
ReportingType and ReportUpdates are now used as enum class in more
places than before. Changed how this two fields are stored in
persistent configuration. Increased Report::Version to break backward
compatibility. Updated unit tests to verify changed functionality.
Tested:
- All existing tests are passing
Change-Id: I55db205aefbe2b5a69fb7a31ccf11885aaecaaf2
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
diff --git a/src/utils/conversion_trigger.cpp b/src/utils/conversion_trigger.cpp
index 5aae0d5..aec0f28 100644
--- a/src/utils/conversion_trigger.cpp
+++ b/src/utils/conversion_trigger.cpp
@@ -22,9 +22,9 @@
return utils::transform(arg, [](const auto& thresholdParam) {
const auto& [type, dwellTime, direction, thresholdValue] =
thresholdParam;
- return numeric::LabeledThresholdParam(
- numeric::stringToType(type), dwellTime,
- numeric::stringToDirection(direction), thresholdValue);
+ return numeric::LabeledThresholdParam(numeric::toType(type), dwellTime,
+ numeric::toDirection(direction),
+ thresholdValue);
});
}
@@ -35,8 +35,7 @@
const auto& [userId, severity, dwellTime, thresholdValue] =
thresholdParam;
return discrete::LabeledThresholdParam(
- userId, discrete::stringToSeverity(severity), dwellTime,
- thresholdValue);
+ userId, discrete::toSeverity(severity), dwellTime, thresholdValue);
});
}