Skip to content

Commit 9742b53

Browse files
omsigumÓmar Högni Guðmarsson
authored and
Ómar Högni Guðmarsson
committed
Allow access to connection in object server
Allow connection object to be accessed out of the dbus_interface. See #83 for reference. Similar pattern to asio's get_executor() method exposed on sockets. Can reduce parameter count when working in code where the dbus_interface is passed around. When components register their own interface onto a preexisting dbus_interface but require access to the connection or the connections underlying execution context. Change-Id: Ie9df1f2762f639de60b492255d6f9d85920b0fd6 Signed-off-by: Ómar Högni Guðmarsson <[email protected]>
1 parent e12a23c commit 9742b53

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

include/sdbusplus/asio/object_server.hpp

+6
Original file line numberDiff line numberDiff line change
@@ -398,6 +398,12 @@ class dbus_interface
398398
std::vector<std::string>{name_});
399399
}
400400

401+
auto connection() const noexcept
402+
-> std::shared_ptr<sdbusplus::asio::connection>
403+
{
404+
return conn_;
405+
}
406+
401407
template <typename PropertyType, typename CallbackTypeGet>
402408
bool register_property_r(const std::string& name,
403409
const PropertyType& property,

0 commit comments

Comments
 (0)