-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce getter for asio::connection in asio::dbus_interface #83
Comments
By the |
@mine260309 Nope, even more simple, here is what I mean: diff --git a/include/sdbusplus/asio/object_server.hpp b/include/sdbusplus/asio/object_server.hpp
index 57dcc95..a4d8ff7 100644
--- a/include/sdbusplus/asio/object_server.hpp
+++ b/include/sdbusplus/asio/object_server.hpp
@@ -398,6 +398,8 @@ class dbus_interface
std::vector<std::string>{name_});
}
+ auto connection() const noexcept -> std::shared_ptr<sdbusplus::asio::connection> { return conn_; }
+
template <typename PropertyType, typename CallbackTypeGet>
bool register_property_r(const std::string& name,
const PropertyType& property, |
@williamspatrick is this something you would consider merging? can be very handy if you are writing a component to minimize the parameter count. Also sort of follows asio convention of getting a io_context. See this for reference https://live.boost.org/doc/libs/1_84_0/doc/html/boost_asio/reference/basic_stream_socket/get_executor.html If so I can create a patch, get a CLA signed and submit to gerrit. |
@omarhogni - Sure. |
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]>
Before I go through the process of making a PR on gerrit.
Do you have something against populating a getter for the shared_ptr of asio::connection within asio::dbus_interface?
The text was updated successfully, but these errors were encountered: