Convert variant usage to std interface
This is just a refactoring to use the c++17 std::variant interfaces
instead of the mapbox::variant specific ones. We should be able to use
mapbox::variant and std::variant interchangeably now.
Tested:
Built against sdbusplus with mapbox::variant and sbusplus using
std::variant. Both variant compile and test out.
Change-Id: I6fbaad3d12dd34968db6a10f3d74a65e07d0f0cc
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/host-cmd-manager.cpp b/host-cmd-manager.cpp
index 2f96661..28bcb70 100644
--- a/host-cmd-manager.cpp
+++ b/host-cmd-manager.cpp
@@ -7,6 +7,7 @@
#include <chrono>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
+#include <sdbusplus/message/types.hpp>
#include <sdbusplus/timer.hpp>
#include <utils.hpp>
#include <xyz/openbmc_project/Common/error.hpp>
@@ -32,6 +33,7 @@
sdbusplus::xyz::openbmc_project::Common::Error::InternalFailure;
namespace sdbusRule = sdbusplus::bus::match::rules;
+namespace variant_ns = sdbusplus::message::variant_ns;
Manager::Manager(sdbusplus::bus::bus& bus, sd_event* event) :
bus(bus), timer(event, std::bind(&Manager::hostTimeout, this)),
@@ -180,7 +182,8 @@
return;
}
- auto& requestedState = properties.at(HOST_TRANS_PROP).get<std::string>();
+ auto& requestedState =
+ variant_ns::get<std::string>(properties.at(HOST_TRANS_PROP));
if (server::Host::convertTransitionFromString(requestedState) ==
server::Host::Transition::On)