sdbusplus: replace message::variant with std::variant
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I7b2bc0a8b34e4d276c0e8ea2243459aab4e1c177
diff --git a/control/types.hpp b/control/types.hpp
index 04621e2..cb9f743 100644
--- a/control/types.hpp
+++ b/control/types.hpp
@@ -31,11 +31,11 @@
using Condition = std::tuple<std::string,
std::vector<ConditionProperty>>;
-using PropertyVariantType = sdbusplus::message::variant<bool,
- int32_t,
- int64_t,
- double,
- std::string>;
+using PropertyVariantType = std::variant<bool,
+ int32_t,
+ int64_t,
+ double,
+ std::string>;
constexpr auto fanNamePos = 0;
constexpr auto sensorListPos = 1;
diff --git a/cooling-type/cooling_type.hpp b/cooling-type/cooling_type.hpp
index 88e1335..5108eeb 100644
--- a/cooling-type/cooling_type.hpp
+++ b/cooling-type/cooling_type.hpp
@@ -20,7 +20,7 @@
class CoolingType
{
using Property = std::string;
- using Value = sdbusplus::message::variant<bool>;
+ using Value = std::variant<bool>;
// Association between property and its value
using PropertyMap = std::map<Property, Value>;
using Interface = std::string;
diff --git a/monitor/fan.hpp b/monitor/fan.hpp
index 663e27e..a581b3b 100644
--- a/monitor/fan.hpp
+++ b/monitor/fan.hpp
@@ -55,7 +55,7 @@
class Fan
{
using Property = std::string;
- using Value = sdbusplus::message::variant<bool>;
+ using Value = std::variant<bool>;
using PropertyMap = std::map<Property, Value>;
using Interface = std::string;
diff --git a/monitor/tach_sensor.cpp b/monitor/tach_sensor.cpp
index e366872..2bf7b06 100644
--- a/monitor/tach_sensor.cpp
+++ b/monitor/tach_sensor.cpp
@@ -181,7 +181,7 @@
T& value)
{
std::string sensor;
- std::map<std::string, sdbusplus::message::variant<T>> data;
+ std::map<std::string, std::variant<T>> data;
msg.read(sensor, data);
if (sensor.compare(interface) == 0)
diff --git a/monitor/types.hpp b/monitor/types.hpp
index 1d47e60..6604778 100644
--- a/monitor/types.hpp
+++ b/monitor/types.hpp
@@ -21,9 +21,9 @@
std::string,
std::string>;
-using PropertyValue = sdbusplus::message::variant<bool,
- int64_t,
- std::string>;
+using PropertyValue = std::variant<bool,
+ int64_t,
+ std::string>;
constexpr auto propIdentity = 0;
constexpr auto propValue = 1;
using PropertyState = std::pair<PropertyIdentity,
diff --git a/sdbusplus.hpp b/sdbusplus.hpp
index 4064f5c..3286fbd 100644
--- a/sdbusplus.hpp
+++ b/sdbusplus.hpp
@@ -117,7 +117,7 @@
/** @brief Alias for PropertiesChanged signal callbacks. */
template <typename ...T>
-using Properties = std::map<std::string, sdbusplus::message::variant<T...>>;
+using Properties = std::map<std::string, std::variant<T...>>;
/** @class SDBusPlus
* @brief DBus access delegate implementation for sdbusplus.
@@ -346,7 +346,7 @@
interface,
property};
}
- sdbusplus::message::variant<Property> value;
+ std::variant<Property> value;
msg.read(value);
return std::get<Property>(value);
}
@@ -440,7 +440,7 @@
interface,
property};
}
- sdbusplus::message::variant<Property> value;
+ std::variant<Property> value;
msg.read(value);
return std::get<Property>(value);
}
@@ -521,7 +521,7 @@
{
using namespace std::literals::string_literals;
- sdbusplus::message::variant<Property> varValue(
+ std::variant<Property> varValue(
std::forward<Property>(value));
auto service = getService(bus, path, interface);
@@ -573,7 +573,7 @@
{
using namespace std::literals::string_literals;
- sdbusplus::message::variant<Property> varValue(
+ std::variant<Property> varValue(
std::forward<Property>(value));
auto msg = callMethodAndReturn(
diff --git a/utility.hpp b/utility.hpp
index f97b505..168bd57 100644
--- a/utility.hpp
+++ b/utility.hpp
@@ -96,7 +96,7 @@
const T& value)
{
using Property = std::string;
- using Value = sdbusplus::message::variant<T>;
+ using Value = std::variant<T>;
using PropertyMap = std::map<Property, Value>;
using Interface = std::string;