Move variant usage to std
Since sdbusplus now uses std, it's cleaner just to
use the variant type directly not behind the namespace.
This was primarily done with sed commands
Tested-by: It builds
Change-Id: I87a90a2942cfc6da312cb0e045cce7cd40a644e5
Signed-off-by: James Feist <james.feist@linux.intel.com>
diff --git a/src/ExitAirTempSensor.cpp b/src/ExitAirTempSensor.cpp
index a8a5748..06eddc0 100644
--- a/src/ExitAirTempSensor.cpp
+++ b/src/ExitAirTempSensor.cpp
@@ -53,8 +53,8 @@
std::function<void(sdbusplus::message::message & message)> eventHandler =
[callback{std::move(callback)}](sdbusplus::message::message& message) {
std::string objectName;
- boost::container::flat_map<
- std::string, sdbusplus::message::variant<double, int64_t>>
+ boost::container::flat_map<std::string,
+ std::variant<double, int64_t>>
values;
message.read(objectName, values);
auto findValue = values.find("Value");
@@ -62,8 +62,8 @@
{
return;
}
- double value = sdbusplus::message::variant_ns::visit(
- VariantToDoubleVisitor(), findValue->second);
+ double value =
+ std::visit(VariantToDoubleVisitor(), findValue->second);
if (std::isnan(value))
{
return;
@@ -328,8 +328,7 @@
return;
}
- inletTemp = sdbusplus::message::variant_ns::visit(
- VariantToDoubleVisitor(), value);
+ inletTemp = std::visit(VariantToDoubleVisitor(), value);
},
"xyz.openbmc_project.HwmonTempSensor",
std::string("/xyz/openbmc_project/sensors/") + inletTemperatureSensor,
@@ -517,8 +516,7 @@
throw std::invalid_argument("Key Missing");
}
BasicVariantType copy = it->second;
- std::vector<std::string> config =
- sdbusplus::message::variant_ns::get<std::vector<std::string>>(copy);
+ std::vector<std::string> config = std::get<std::vector<std::string>>(copy);
for (auto& str : config)
{
boost::replace_all(str, " ", "_");