added Enabled to AddReportFutureVersion API
- New parameter added to API
- Changed API to be more flexible in the future
Tested:
- Unit tests are passing
- Tested together with:
https://gerrit.openbmc.org/c/openbmc/bmcweb/+/49796/23
POST, PATCH, PUT for MetricReportDefinitions are working correctly
Signed-off-by: Krzysztof Grobelny <krzysztof.grobelny@intel.com>
Change-Id: Ic988446d283a581dc6866418b1b27a989c3bc9a0
diff --git a/src/utils/circular_vector.hpp b/src/utils/circular_vector.hpp
index f7ac8e5..be13873 100644
--- a/src/utils/circular_vector.hpp
+++ b/src/utils/circular_vector.hpp
@@ -53,6 +53,11 @@
return vec.end();
}
+ size_t size() const
+ {
+ return maxSize;
+ }
+
private:
std::vector<T>& vec;
size_t maxSize = 0;
diff --git a/src/utils/variant_utils.hpp b/src/utils/variant_utils.hpp
new file mode 100644
index 0000000..0843818
--- /dev/null
+++ b/src/utils/variant_utils.hpp
@@ -0,0 +1,31 @@
+#pragma once
+
+#include <concepts>
+#include <variant>
+
+namespace utils
+{
+namespace details
+{
+
+template <class T, class... Args>
+auto removeMonostate(std::variant<T, Args...>) -> std::variant<T, Args...>;
+
+template <class... Args>
+auto removeMonostate(std::variant<std::monostate, Args...>)
+ -> std::variant<Args...>;
+
+template <class Variant>
+struct WithoutMonostate
+{
+ private:
+ public:
+ using type = decltype(removeMonostate(Variant{}));
+};
+
+} // namespace details
+
+template <class Variant>
+using WithoutMonostate = typename details::WithoutMonostate<Variant>::type;
+
+} // namespace utils