summaryrefslogtreecommitdiffstats
path: root/sdbusplus.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'sdbusplus.hpp')
-rw-r--r--sdbusplus.hpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/sdbusplus.hpp b/sdbusplus.hpp
index eb380cc..5842133 100644
--- a/sdbusplus.hpp
+++ b/sdbusplus.hpp
@@ -471,6 +471,50 @@ class SDBusPlus
std::forward<Property>(value));
}
+ /** @brief Set a property without mapper lookup. */
+ template <typename Property>
+ static void setProperty(
+ sdbusplus::bus::bus& bus,
+ const std::string& service,
+ const std::string& path,
+ const std::string& interface,
+ const std::string& property,
+ Property&& value)
+ {
+ using namespace std::literals::string_literals;
+
+ sdbusplus::message::variant<Property> varValue(
+ std::forward<Property>(value));
+
+ callMethod(
+ bus,
+ service,
+ path,
+ "org.freedesktop.DBus.Properties"s,
+ "Set"s,
+ interface,
+ property,
+ varValue);
+ }
+
+ /** @brief Set a property without mapper lookup. */
+ template <typename Property>
+ static void setProperty(
+ const std::string& service,
+ const std::string& path,
+ const std::string& interface,
+ const std::string& property,
+ Property&& value)
+ {
+ return setProperty(
+ getBus(),
+ service,
+ path,
+ interface,
+ property,
+ std::forward<Property>(value));
+ }
+
/** @brief Invoke method with mapper lookup. */
template <typename ...Args>
static auto lookupAndCallMethod(
OpenPOWER on IntegriCloud