diff options
author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2016-11-30 14:35:02 -0500 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2017-01-12 16:53:38 -0500 |
commit | da649b144c51b4b941998f961bdc93435ee80947 (patch) | |
tree | eef1b8f0cc5bafc314946624dce687267a564d37 /manager.hpp | |
parent | b83a21ea3eb4848ae7009d6010062aa01620edd5 (diff) | |
download | phosphor-inventory-manager-da649b144c51b4b941998f961bdc93435ee80947.tar.gz phosphor-inventory-manager-da649b144c51b4b941998f961bdc93435ee80947.zip |
Add setProperty action
The setProperty action sets a property to a predefined
value when a match occurs.
Change-Id: Ibd3cbb0da86a99e823b9cc00cc0240772d895f7f
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'manager.hpp')
-rw-r--r-- | manager.hpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/manager.hpp b/manager.hpp index 6326336..0954953 100644 --- a/manager.hpp +++ b/manager.hpp @@ -99,6 +99,33 @@ class Manager final : /** @brief Drop an object from DBus. */ void destroyObject(const char *); + /** @brief Invoke an sdbusplus server binding method. + * + * Invoke the requested method with a reference to the requested + * sdbusplus server binding interface as a parameter. + * + * @tparam T - The sdbusplus server binding interface type. + * @tparam U - The type of the sdbusplus server binding member. + * @tparam Args - Argument types of the binding member. + * + * @param[in] path - The DBus path on which the method should + * be invoked. + * @param[in] interface - The DBus interface hosting the method. + * @param[in] member - Pointer to sdbusplus server binding member. + * @param[in] args - Arguments to forward to the binding member. + * + * @returns - The return/value type of the binding method being + * called. + */ + template<typename T, typename U, typename ...Args> + decltype(auto) invokeMethod(const char *path, const char *interface, + U&& member, Args&&...args) + { + auto &holder = getInterface<std::unique_ptr<T>>(path, interface); + auto &iface = *holder.get(); + return (iface.*member)(std::forward<Args>(args)...); + } + using SigArgs = std::vector< std::unique_ptr< std::tuple< |