sdbusplus: replace message::variant with std::variant
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: Iea684a5a06d6d8f3e83b0dc1d7b8080dc2751466
diff --git a/functor.hpp b/functor.hpp
index 0c328d9..67dc4de 100644
--- a/functor.hpp
+++ b/functor.hpp
@@ -211,7 +211,7 @@
bool operator()(sdbusplus::bus::bus&, sdbusplus::message::message& msg,
Manager&) const
{
- std::map<std::string, sdbusplus::message::variant<T>> properties;
+ std::map<std::string, std::variant<T>> properties;
const char* iface = nullptr;
msg.read(iface);
@@ -351,7 +351,7 @@
*/
bool eval(sdbusplus::message::message& msg) const override
{
- sdbusplus::message::variant<T> value;
+ std::variant<T> value;
msg.read(value);
return _condition(std::forward<T>(std::get<T>(value)));
}
diff --git a/test/test.cpp b/test/test.cpp
index 2222580..cea8b89 100644
--- a/test/test.cpp
+++ b/test/test.cpp
@@ -236,7 +236,7 @@
auto m = set(trigger4.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty2");
- m.append(sdbusplus::message::variant<std::string>("123"));
+ m.append(std::variant<std::string>("123"));
b.call(m);
auto sig{queue.pop()};
assert(!sig);
@@ -250,7 +250,7 @@
auto m = set(trigger4.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty2");
- m.append(sdbusplus::message::variant<std::string>("xyz"));
+ m.append(std::variant<std::string>("xyz"));
b.call(m);
auto sig{queue.pop()};
assert(!sig);
@@ -261,7 +261,7 @@
auto m = set(trigger4.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty3");
- m.append(sdbusplus::message::variant<int64_t>(99));
+ m.append(std::variant<int64_t>(99));
b.call(m);
auto sig{queue.pop()};
assert(!sig);
@@ -271,7 +271,7 @@
auto m = set(trigger4.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty2");
- m.append(sdbusplus::message::variant<std::string>("123"));
+ m.append(std::variant<std::string>("123"));
b.call(m);
sdbusplus::message::object_path sigpath;
@@ -312,7 +312,7 @@
auto m = set(trigger1.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty2");
- m.append(sdbusplus::message::variant<std::string>("abc123"));
+ m.append(std::variant<std::string>("abc123"));
b.call(m);
auto sig{queue.pop()};
assert(!sig);
@@ -322,7 +322,7 @@
auto m = set(trigger3.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty3");
- m.append(sdbusplus::message::variant<int64_t>(11));
+ m.append(std::variant<int64_t>(11));
b.call(m);
auto sig{queue.pop()};
assert(!sig);
@@ -335,7 +335,7 @@
auto m = set(trigger1.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty2");
- m.append(sdbusplus::message::variant<std::string>("xxxyyy"));
+ m.append(std::variant<std::string>("xxxyyy"));
b.call(m);
sdbusplus::message::object_path sigpath;
@@ -372,7 +372,7 @@
auto m = set(trigger3.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty3");
- m.append(sdbusplus::message::variant<int64_t>(10));
+ m.append(std::variant<int64_t>(10));
b.call(m);
sdbusplus::message::object_path sigpath;
@@ -413,12 +413,11 @@
auto m = set(trigger2.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty2");
- m.append(sdbusplus::message::variant<std::string>("yyyxxx"));
+ m.append(std::variant<std::string>("yyyxxx"));
b.call(m);
std::string sigInterface;
- std::map<std::string, sdbusplus::message::variant<std::string>>
- sigProperties;
+ std::map<std::string, std::variant<std::string>> sigProperties;
{
std::vector<std::string> interfaces;
auto sig{queue.pop()};
@@ -448,7 +447,7 @@
auto m = set(trigger5.str);
m.append("xyz.openbmc_project.Example.Iface2");
m.append("ExampleProperty2");
- m.append(sdbusplus::message::variant<std::string>("abc123"));
+ m.append(std::variant<std::string>("abc123"));
b.call(m);
{
auto sig{queue.pop()};