feat: add cookie-related API to Message (#491)

Add `Message::getCookie()` and `MethodReply::getReplyCookie()` functions, based on underlying sd-bus cookie functions. They can be useful when pairing method call messages and method call reply messages.

---------

Co-authored-by: Dylan Howey <dylan.howey@evgo.com>
Co-authored-by: Stanislav Angelovič <stanislav.angelovic@protonmail.com>
This commit is contained in:
Dylan Howey
2025-05-05 08:04:20 +02:00
committed by GitHub
co-authored by Dylan Howey Stanislav Angelovič
parent 4389ea39bf
commit 6212b12159
6 changed files with 40 additions and 0 deletions
+2
View File
@@ -215,6 +215,7 @@ namespace sdbus {
const char* getSender() const;
const char* getPath() const;
const char* getDestination() const;
uint64_t getCookie() const;
// TODO: short docs in whole Message API
std::pair<char, const char*> peekType() const;
bool isValid() const;
@@ -296,6 +297,7 @@ namespace sdbus {
public:
MethodReply() = default;
void send() const;
uint64_t getReplyCookie() const;
};
class Signal : public Message