summaryrefslogtreecommitdiffstats
path: root/sensorhandler.cpp
diff options
context:
space:
mode:
authorWilliam A. Kennington III <wak@google.com>2018-10-12 17:18:14 -0700
committerWilliam A. Kennington III <wak@google.com>2018-10-18 15:08:55 -0700
commit4c0080287f2bb19ecfbe5cdd4a334f8769e7d0cd (patch)
treef2edadbb00b55c212c280c90f0cb35d96702bf4e /sensorhandler.cpp
parent1181af741589db873676f177ed85d6bc04884aa1 (diff)
downloadphosphor-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 'sensorhandler.cpp')
-rw-r--r--sensorhandler.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/sensorhandler.cpp b/sensorhandler.cpp
index 08a6325..dca9765 100644
--- a/sensorhandler.cpp
+++ b/sensorhandler.cpp
@@ -14,6 +14,7 @@
#include <cstring>
#include <phosphor-logging/elog-errors.hpp>
#include <phosphor-logging/log.hpp>
+#include <sdbusplus/message/types.hpp>
#include <set>
#include <xyz/openbmc_project/Common/error.hpp>
#include <xyz/openbmc_project/Sensor/Value/server.hpp>
@@ -453,10 +454,10 @@ void getSensorThresholds(uint8_t sensorNum,
auto warnThresholds = ipmi::getAllDbusProperties(
bus, service, info.sensorPath, warningThreshIntf);
- double warnLow = variant_ns::apply_visitor(ipmi::VariantToDoubleVisitor(),
- warnThresholds["WarningLow"]);
- double warnHigh = variant_ns::apply_visitor(ipmi::VariantToDoubleVisitor(),
- warnThresholds["WarningHigh"]);
+ double warnLow = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
+ warnThresholds["WarningLow"]);
+ double warnHigh = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
+ warnThresholds["WarningHigh"]);
if (warnLow != 0)
{
@@ -478,10 +479,10 @@ void getSensorThresholds(uint8_t sensorNum,
auto critThresholds = ipmi::getAllDbusProperties(
bus, service, info.sensorPath, criticalThreshIntf);
- double critLow = variant_ns::apply_visitor(ipmi::VariantToDoubleVisitor(),
- critThresholds["CriticalLow"]);
- double critHigh = variant_ns::apply_visitor(ipmi::VariantToDoubleVisitor(),
- critThresholds["CriticalHigh"]);
+ double critLow = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
+ critThresholds["CriticalLow"]);
+ double critHigh = variant_ns::visit(ipmi::VariantToDoubleVisitor(),
+ critThresholds["CriticalHigh"]);
if (critLow != 0)
{
OpenPOWER on IntegriCloud