Name Date Size #Lines LOC

..Today-

cmake/H07-Mar-2021-732653

include/dbus/H07-Mar-2021-2,8142,039

test/H07-Mar-2021-938659

.clang-formatH A D07-Mar-20212.7 KiB9694

.gitignoreH A D07-Mar-20216 21

CMakeLists.txtH A D07-Mar-20213.2 KiB10984

JenkinsfileH A D07-Mar-2021471 2418

LICENSE_1_0.txtH A D07-Mar-20211.3 KiB2420

MAINTAINERSH A D07-Mar-20211.9 KiB4836

README.mdH A D07-Mar-20211,005 5641

README.md

1Boost D-Bus
2===========
3
4This is a simple D-Bus binding powered by Boost.Asio.
5As far as possible, I try to follow Asio's idioms.
6
7Code Sample
8-----------
9
10```c++
11#include <iostream>
12
13#include <boost/asio.hpp>
14#include <dbus.hpp>
15
16using namespace std;
17using namespace boost::asio;
18using boost::system::error_code;
19
20struct logger
21{
22  void operator()(error_code ec, message m)
23  {
24	cout << m << endl;
25  }
26};
27
28void main()
29{
30  io_service io;
31  dbus::proxy avahi(io,
32    dbus::endpoint(
33	"org.freedesktop.Avahi", // proxied object process
34	"/",                     // proxied object path
35	"org.freedesktop.Avahi.Server")); // interface
36
37  dbus::message browser_spec(-1, -1,
38    "_http._tcp", "local", unsigned(0));
39
40  dbus::message response =
41    avahi.call("ServiceBrowserNew", browser_spec);
42
43  dbus::proxy browser(io,
44    dbus::endpoint(
45	"org.freedesktop.Avahi",
46	response.get(0),
47	"org.freedesktop.Avahi.ServiceBrowser"));
48
49  browser.async_receive("ItemNew", logger());
50
51  io.run();
52}
53
54
55```
56