diff options
| author | Patrick Venture <venture@google.com> | 2018-04-16 09:40:21 -0700 |
|---|---|---|
| committer | Patrick Venture <venture@google.com> | 2018-05-29 12:31:08 -0700 |
| commit | b9a1e196fccbf1a391db007f600d3b1f65acff53 (patch) | |
| tree | 3b2eff612fb458a8138f142297c5ac89f7027414 | |
| parent | ff095681d33f633a394ba1341282c3b8e40a643f (diff) | |
| download | sdbusplus-b9a1e196fccbf1a391db007f600d3b1f65acff53.tar.gz sdbusplus-b9a1e196fccbf1a391db007f600d3b1f65acff53.zip | |
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>
| -rw-r--r-- | sdbusplus/bus.hpp.in | 9 |
1 files changed, 9 insertions, 0 deletions
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 @@ struct bus 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; |

