diff options
author | William A. Kennington III <wak@google.com> | 2018-10-12 17:18:14 -0700 |
---|---|---|
committer | William A. Kennington III <wak@google.com> | 2018-10-18 15:08:55 -0700 |
commit | 4c0080287f2bb19ecfbe5cdd4a334f8769e7d0cd (patch) | |
tree | f2edadbb00b55c212c280c90f0cb35d96702bf4e /host-cmd-manager.cpp | |
parent | 1181af741589db873676f177ed85d6bc04884aa1 (diff) | |
download | phosphor-host-ipmid-4c0080287f2bb19ecfbe5cdd4a334f8769e7d0cd.tar.gz phosphor-host-ipmid-4c0080287f2bb19ecfbe5cdd4a334f8769e7d0cd.zip |
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>
Diffstat (limited to 'host-cmd-manager.cpp')
-rw-r--r-- | host-cmd-manager.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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 @@ using InternalFailure = 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 @@ void Manager::clearQueueOnPowerOn(sdbusplus::message::message& msg) 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) |