Commit Graph
29 Commits
Author SHA1 Message Date
Stanislav Angelovič c769637f3b chore: update years in header comments 2024-04-16 22:48:34 +02:00
Stanislav Angelovič e2b3e98374 refactor: improve handling of exceptions from callback handlers (#375)
* Catch and process all exceptions (not just sdbus::Error) from callback handlers
* Unify handling of exceptions from all types of callbacks -- always set sd_bus_error and return a negative result number in case of exception

Although libsystemd logs (with DEBUG severity) all errors from such callback handlers (except method callback handler), it seems to be out of our control. One of handy sdbus-c++ features could be the ability for clients to install a log callback, which sdbus-c++ would call in case of exceptions flying from callback handlers. In case something doesn't work for clients (especially novices), they can first look into these logs.

This may be handy in common situations like ignored signals on client side because of the inadvertent mismatch between real signal signature and signal handler signature. Like here: #373. (Although in this specific case of signals, there is a solution with an additional const sdbus::Error* argument that would reveal such an error.)
2023-11-03 18:03:01 +01:00
Jan Beich 1e2d13a04a feat: add FreeBSD support (#358)
* chore: don't use systemd headers with elogind

In file included from src/VTableUtils.c:27:
src/VTableUtils.h:30:10: fatal error: 'systemd/sd-bus.h' file not found
 #include <systemd/sd-bus.h>
          ^~~~~~~~~~~~~~~~~~

* chore: add basu support

Similar to elogind but also supported on non-Linux.

* chore(tests): permit /var/lib/machine-id on non-systemd

https://github.com/elogind/elogind/commit/84fdc0fc61c1
https://git.sr.ht/~emersion/basu/commit/8324e6729231

* chore(ci): add simple freebsd job

Mainly to cover libc++ and basu.

* chore(ci): explicitly pass CMAKE_INSTALL_PREFIX

Some sdbus-cpp tests require configuring system bus. However, Linux
testing relies on writing outside of prefix in order to affect current
system bus instance instead of launching a dedicated one.

* chore(tests): respect CMAKE_INSTALL_PREFIX for system bus config

DBus isn't part of base system on BSDs, so may not use /etc for configs.
Also, testing installation failed as non-root:

$ cmake -DBUILD_TESTS=1 -DCMAKE_INSTALL_PREFIX=/tmp/sdbus-cpp_prefix -DTESTS_INSTALL_PATH=/tmp/sdbus-cpp_prefix/tests
$ cmake --build .
$ cmake --install .
[...]
CMake Error at tests/cmake_install.cmake:105 (file):
  file cannot create directory: /etc/dbus-1/system.d.  Maybe need
  administrative privileges.

* chore(tests): temporarily skip 1 test on FreeBSD to keep CI happy

* chore(ci): run tests in freebsd job
2023-09-18 11:35:23 +02:00
Stanislav Angelovic e07c1f3981 chore: update doxygen header info 2022-07-05 18:10:05 +02:00
Stanislav Angelovic b7f3d7c876 refactor: little fixes and reorganizations around Connection class 2022-06-22 18:12:42 +02:00
Stanislav Angelovič b7a9c63ff0 refactor: add validity checks for names and paths (#242) 2022-02-11 21:53:37 +01:00
Stanislav Angelovic d77bb6b869 Fix potential race condition in Object destruction 2021-09-17 19:03:15 +02:00
Stanislav Angelovic b4f5c0f46c Catch sdbus-c++ exceptions flying from Proxy callbacks to libsystemd 2021-07-29 12:37:15 +02:00
Stanislav Angelovic e16ffb1288 Provide access to D-Bus message in high-level API 2021-06-22 11:31:08 +02:00
ChristianS99andChristian Schneider ae8849e545 Implement #104: add getObjectPath() for classes (#105)
* Implement #104: add getObjectPath() for classes

* Implement #104: changes requested in review

Co-authored-by: Christian Schneider <cschneider@radiodata.biz>
2020-05-28 15:36:58 +02:00
sangelovic 975f1bf07f Switch to fully supported C++17 2020-02-01 22:58:34 +01:00
sangelovic eade6a0e44 Add support for method and signal parameter names in introspection 2020-02-01 12:38:39 +01:00
sangelovic 4310a3bd17 Little fix of order of destruction in stress tests 2020-01-19 18:57:14 +01:00
sangelovic d50a15b2a2 Move C++17 uncaught_exceptions to public API 2019-11-10 17:31:58 +01:00
Stanislav Angelovic ab34b0ae50 Update header doxy comments in source files 2019-06-11 20:18:37 +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 38b51bddc6 Add support for ObjectManager's InterfaceAdded/Removed signals on server side 2019-06-03 23:47:27 +02:00
Stanislav Angelovič 01e2a7a570 Add support for PropertyChanged signal on server side 2019-06-03 22:02:15 +02:00
Stanislav Angelovič 91fa35140b Add support for ObjectManager and other standard D-Bus interfaces (#55)
Fixes #50
2019-05-29 22:28:15 +02:00
sangelovic e3a74a3ff2 Add unregister function to IObject and IProxy API 2019-04-13 21:17:37 +02:00
Stanislav Angelovic 94fd3c88d8 Add getConnection() method to IObject so we ask Object about its connection 2019-04-04 20:39:03 +02:00
sangelovic 08945acbc4 Simplify and unify callback design for both sync and async methods 2019-04-03 00:05:20 +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
sangelovic 41a10d644f Make code a bit cleaner and more consistent 2019-03-19 20:11:18 +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
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