Skip to content

Commit

Permalink
Added from_retained method to SimpleDBus Message
Browse files Browse the repository at this point in the history
  • Loading branch information
kdewald committed Oct 21, 2024
1 parent 7a0cb18 commit 6ee30d8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions simpledbus/include/simpledbus/base/Message.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Message {
bool is_signal(const std::string& interface, const std::string& signal_name) const;
bool is_method_call(const std::string& interface, const std::string& method) const;

static Message from_retained(DBusMessage* msg);
static Message from_acquired(DBusMessage* msg);
static Message create_method_call(const std::string& bus_name, const std::string& path,
const std::string& interface, const std::string& method);
Expand Down
10 changes: 10 additions & 0 deletions simpledbus/src/base/Message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,16 @@ Holder Message::_extract_generic(DBusMessageIter* iter) {
return Holder();
}

Message Message::from_retained(DBusMessage* msg) {
Message message;
if (msg) {
dbus_message_ref(msg);
message._msg = msg;
message._unique_id = _creation_counter++;
}
return message;
}

Message Message::from_acquired(DBusMessage* msg) {
Message message;
if (msg) {
Expand Down

0 comments on commit 6ee30d8

Please sign in to comment.