sdbusplus::bus::bus Add getInterface() method
Added a getInterface() method to allow objects that
interact with this bus to grab the SdBusInterface,
such that they can be injected with a mock without changing
how they are created or behave.
Change-Id: Ia733dd7ba1b89280421d06fe5a3b390ea8e9f06f
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/sdbusplus/bus.hpp.in b/sdbusplus/bus.hpp.in
index 0682d86..c19c2f5 100644
--- a/sdbusplus/bus.hpp.in
+++ b/sdbusplus/bus.hpp.in
@@ -357,6 +357,15 @@
return result;
}
+ /** @brief Get the SdBusInterface used by this bus.
+ *
+ * @return A pointer to the SdBusInterface used by this bus.
+ */
+ sdbusplus::SdBusInterface* getInterface()
+ {
+ return _intf;
+ }
+
friend struct server::interface::interface;
friend struct server::manager::manager;
template <class... Args> friend struct server::object::object;