async: context: add implicit conversion to bus_t
Many existing sdbusplus library calls expect a `bus_t`. Add an
implicit conversion to `bus_t&` so that a `context_t&` can be passed
into any function that formerly accepted a `bus_t&`.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I791bf88d86ba5761a4d2fa9bf811b6e794b097af
diff --git a/src/async/context.cpp b/src/async/context.cpp
index 5bb58ae..b324c6c 100644
--- a/src/async/context.cpp
+++ b/src/async/context.cpp
@@ -281,7 +281,7 @@
// Get the bus' timeout.
uint64_t to_usec = 0;
- sd_bus_get_timeout(get_busp(ctx.get_bus()), &to_usec);
+ sd_bus_get_timeout(get_busp(ctx), &to_usec);
if (to_usec == UINT64_MAX)
{
diff --git a/src/async/match.cpp b/src/async/match.cpp
index ed5237b..7dceba4 100644
--- a/src/async/match.cpp
+++ b/src/async/match.cpp
@@ -13,8 +13,8 @@
};
sd_bus_slot* s;
- auto r = sd_bus_add_match(get_busp(ctx.get_bus()), &s, pattern.data(),
- match_cb, this);
+ auto r = sd_bus_add_match(get_busp(ctx), &s, pattern.data(), match_cb,
+ this);
if (r < 0)
{
throw exception::SdBusError(-r, "sd_bus_add_match (async::match)");