Move to common variant
This saves approximately 34kB in the compressed binary size of bmcweb
due to reduced template instantiations. This amounts to a 2.5%
reduction in the overall size.
Note, there were a few places where we broke const-correctness in the
form of pulling a non-const reference out of a const variant. This
new variant now requires const correctness, so some consts are
added where required.
Tested: Code compiles.
Signed-off-by: Ed Tanous <edtanous@google.com>
Change-Id: I6a60c8881c1268627eedb4ffddf16689dc5f6ed2
diff --git a/redfish-core/lib/telemetry_service.hpp b/redfish-core/lib/telemetry_service.hpp
index b79a5cd..c3082d7 100644
--- a/redfish-core/lib/telemetry_service.hpp
+++ b/redfish-core/lib/telemetry_service.hpp
@@ -3,10 +3,9 @@
#include "utils/telemetry_utils.hpp"
#include <app.hpp>
+#include <dbus_utility.hpp>
#include <registries/privilege_registry.hpp>
-#include <variant>
-
namespace redfish
{
@@ -27,9 +26,10 @@
"/redfish/v1/TelemetryService/Triggers";
crow::connections::systemBus->async_method_call(
- [asyncResp](const boost::system::error_code ec,
- const std::vector<std::pair<
- std::string, std::variant<uint32_t, uint64_t>>>& ret) {
+ [asyncResp](
+ const boost::system::error_code ec,
+ const std::vector<
+ std::pair<std::string, dbus::utility::DbusVariantType>>& ret) {
if (ec == boost::system::errc::host_unreachable)
{
asyncResp->res.jsonValue["Status"]["State"] = "Absent";