Commit Graph
37 Commits
Author SHA1 Message Date
Stanislav Angelovič 3e84b254e9 refactor: improve type extensibility and its safety (#348) 2023-08-09 12:39:16 +02:00
Stanislav Angelovič 24a3d83c3f chore: fix file permissions 2023-08-04 13:30:34 +02:00
Stanislav AngelovičandMarcel Hellwig fb61420bf0 feat: support serialization of array, span and unordered_map (#342)
* feat: support serialization of array, span and unordered_map

* fix some spelling mistakes

* docs: update table of valid c++ types

---------

Co-authored-by: Marcel Hellwig <github@cookiesoft.de>
2023-08-03 13:55:37 +02:00
29c877a89a perf: optimize serialization of arrays of trivial D-Bus types (#340)
* Improve performance of std::vector<> per Issue #339.

* refactor: improve performance of vector serialization

---------

Co-authored-by: Plinio Andrade <plinio.andrade@oracle.com>
Co-authored-by: Stanislav Angelovič <stanislav.angelovic@protonmail.com>
2023-07-27 18:31:49 +02:00
Stanislav Angelovič 98f4929337 fix: pseudo-connection static lifetime issue 2023-07-26 08:57:21 +02:00
Stanislav Angelovic 2991fa4960 refactor: use pseudo D-Bus connection for plain messages 2022-08-09 08:55:29 +02:00
Stanislav Angelovic e07c1f3981 chore: update doxygen header info 2022-07-05 18:10:05 +02:00
Stanislav Angelovic d864e1dfa4 refactor: rename dont_request_slot tag to floating_slot 2022-06-27 12:05:06 +02:00
Stanislav Angelovic b7f3d7c876 refactor: little fixes and reorganizations around Connection class 2022-06-22 18:12:42 +02:00
Stanislav Angelovic b8eb0e8ceb fix: minor fixes for async timeout handling 2021-12-21 13:52:14 +01:00
bb0f3f0242 Fix #88: Timeout handling. (#91)
fix timeout handling

* Despite what is documented in sd_bus_get_timeout(3), the timeout
  returned is actually an absolute time point of Linux's CLOCK_MONOTONIC
  clock. Hence, we first have to subtract the current time from the
  timeout in order to get a relative time that can be passed to poll.

* For async call timeouts to reliably work, we need a way to notify the
  event loop of a connection that is currently blocked waiting in poll.
  I.e. assume the event loop thread entered poll with a timeout set to
  T1. Afterwards, the main thread starts an async call C with a timeout
  T2 < T1. In order for C to be canceled after its timeout T1 has
  elapsed, we have to be able to notify the event loop so that it can
  update its poll data.

Co-authored-by: Urs Ritzmann <ursritzmann@protonmail.ch>
Co-authored-by: Lukasz Marcul <lukasz.marcul@onemeter.com>
2021-12-20 10:00:29 +01:00
Benjamin Kaufmann a5e94f07bf Fix issue #135: Segfault in Message::peekType()
* Add missing nullptr check in Message::peekType().

* According to its specification, sd_bus_message_peek_type() sets a
  given contents parameter to NULL if the next element in a message is
  not a container. Since assigning a nullptr to a std::string has
  undefined behaviour (typically resulting in an invalid memory access),
  Message::peekType() must not assign contentsSig unconditionally.
2021-06-15 15:26:10 +02:00
Marek Blaha 118faa58f6 Add API to get message path and message destination (#167)
* Add API to get message path

* Add API to get message destination

* Handle NULL message fields interface and member

Functions sd_bus_message_get_interface() and sd_bus_message_get_member()
can return null in case the message does not use those fields or does
not have them set.
2021-05-07 15:24:21 +02:00
Stanislav Angelovic b0a72cbe92 Make Message's setDestination() thread safe 2021-04-29 15:30:56 +00:00
Marek Blaha 5ee4c61a1b Add API to set signal destination (#168)
With this patch it is possible to create unicast signals.
2021-04-29 17:18:04 +02:00
alivenetsandStanislav Angelovič 5e03e78451 feat: add API to get message credentials (#151)
* sdbus-cpp: Add API to get message credentials

Signed-off-by: Alexander Livenets <a.livenets@gmail.com>

* fix: add <sys/types.h> include for gid_t and other types

Co-authored-by: Stanislav Angelovič <angelovic.s@gmail.com>
2021-03-12 14:14:23 +01:00
sangelovic 75709e31f1 Fix sporadic race condition between Variant and underlying bus
The underlying bus was thread_local, but the design assumption that Variants built on top of that instance won't outlive the thread was incorrect. In stress tests, Variants were moved (and this is completely legal) to a different thread.
2020-01-25 22:31:41 +01:00
sangelovic 4310a3bd17 Little fix of order of destruction in stress tests 2020-01-19 18:57:14 +01:00
sangelovic f41d9bc395 Fix issue of event loop thread and synchronous method call thread polling on the same D-Bus connection
Synchronous D-Bus method calls are now done in terms of blocking asynchronous calls.
2020-01-19 18:51:19 +01:00
lubo-svk c139110112 Add support for custom timeout value for D-Bus method calls (#72) 2019-11-03 13:54:13 +01:00
sangelovic e30ce194ab Add getSenderName method to Message 2019-10-06 11:28:16 +02:00
Stanislav Angelovič a09362f79a Switch from plain UnixFd to owning UnixFd (#69) 2019-07-08 09:53:53 +02:00
Stanislav Angelovic ab34b0ae50 Update header doxy comments in source files 2019-06-11 20:18:37 +02:00
sangelovic 236c10ff56 Resolve a few clang-tidy suggestions and warnings (thanks to @ardazishvili)
Fixes part of #52.
2019-06-10 21:54:02 +02:00
Stanislav Angelovič dcad208ffe Redesign inheritance from Message (#62)
... so that the code is more idiomatic, clear and expressive about its intended use
2019-06-10 21:38:30 +02:00
sangelovic 57c840637c Add support for Unix fd D-Bus type 2019-06-10 21:19:56 +02:00
sangelovic b87b0c9dd9 Fix the way of handling thread-local system bus 2019-05-12 10:23:26 +02:00
Stanislav Angelovic 7763c66513 Add support for libsystemd versions up to the newest 242, and set 242 as default version 2019-05-09 19:16:16 +02:00
sangelovic e3a74a3ff2 Add unregister function to IObject and IProxy API 2019-04-13 21:17:37 +02:00
Stanislav Angelovic 1c4abab3e4 Remove executable bit erroneously set on source files 2019-03-27 17:53:31 +01:00
Stanislav Angelovič fd7be39dd4 Re-design sdbus-c++ approach to connections (#47)
Fixes #33 , among others
2019-03-25 16:28:31 +01:00
Stanislav Angelovič 663df31398 Introduce support for asynchronous D-Bus method calls on the client side (#42)
Fixes #32
2019-03-25 14:45:48 +01:00
Stanislav Angelovič 9c0e98c580 Introduce support for some common D-Bus annotations (#30)
* Add ability to declare property behavior on PropertyChanged signal

* Add support for Method.NoReply annotation (WIP)

* Add support for common annotations/flags
2019-01-10 08:47:59 +01:00
Stanislav Angelovič d8fd053714 Introduce support for asynchronous server-side methods (#12)
* Add preliminary changes for async server methods

* Refactor the Message concept and break it into distinctive types

* Continue working on async server methods (high-level API mainly)

* Continue developing support for async server

* Finishing async server methods

* Finishing async server methods (fixing tests & cleaning up)

* A little code cleaning

* Add unit tests for type traits of free functions

* Support for generating async server methods in stub headers

* Update ChangeLog for v0.3.0

* Update the tutorial with how to use async server-side methods

* Update the TOC in sdbus-c++ tutorial

* Update numbering in TOC

* Remove unnecessary code

* Final cleanups
2018-07-02 11:22:00 +02:00
Lukas Durfina dfdc6b153e Message: fix missing release of sd_bus_message 2018-06-19 08:56:28 +02:00
Stanislav Angelovic b535198571 Little code cleanups and refactorings 2018-05-25 20:48:20 +02:00
Stanislav Angelovic 35f725a053 Introduce sdbus-c++ v0.2.3 2017-11-27 14:13:55 +01:00