dbus-cxx logo
hal_proxy.cpp

This is an example of an ObjectProxy generated by dbus-cxx-xml2cpp from a modified dbus introspection XML document.

dbus-cxx-xml2cpp
The command used to generate hal_manager_proxy.h from hal_manager_introspection.xml is:
dbus-cxx-xml2cpp --xml hal_manager_introspection.xml --proxy -f --prefix="hal_"
Modifying the DBus introspected XML
dbus-cxx-xml2cpp uses a modified XML document obtained via introspection. In this example several attributes were added to the node tag and the introspection interface tag.
The node tag was changed from this:
<node>
to this:
<node gen-namespace="DBus::Hal" cppname="Manager" dest="org.freedesktop.Hal" path="/org/freedesktop/Hal/Manager" >
The introspection interface tag had the ignored attribute added to prevent the interface from being built changing it from this:
<interface name="org.freedesktop.DBus.Introspectable">
to this:
<interface name="org.freedesktop.DBus.Introspectable" ignored="1">
Source xml
Here is the modified xml document:
Generated Proxy Object
After running dbus-cxx-xml2cpp results in a .h file containing the definition of the proxy class. Here is the resulting hal_manager_proxy.h:

And finally, here is the example application that uses the proxy to watch for device added/removed signals.


Generated on Sun Mar 19 2017 14:54:26 for dbus-cxx by doxygen 1.8.8