sdbusplus match interface changes
patrick at stwcx.xyz
Sat May 6 07:09:39 AEST 2017
There are three changes that I made recently to the sdbusplus match APIs
that I'd like new code to start using. I'm going through the existing
openbmc repositories and making the changes to existing code.
1. Namespace move.
The sdbusplus::server::match namespace is now sdbusplus::bus::match,
but there is a temporary alias for the old namespace still in place.
Once I get all changes merged in the user repositories, I'll remove
This change was proposed by someone outside OpenBMC that was using
the library. I agreed that the 'match' utilities should not be in
server because they are just as likely to be used by a dbus-client.
2. Addition of match rule utilities.
I added a number of utilities in the sdbus::bus::match::rules
namespace that can be used to create signal match rules instead of
type::signal() + member("JobRemoved") +
3. Support for std::function-type callbacks.
Previously, when you had a class member function you wanted to have as
the callback for a dbus signal, you needed to make a static member
static int callback(msg, void* context)
match m = match(..., &MyClass::callback, this);
You can now avoid writing the trampoline function by using
match m = match(..., std::bind(std::mem_fn(&MyClass::callback),
The first repository I modified to take advantage of these three changes
is phosphor-state-manager. You can find that review here as an example:
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 833 bytes
Desc: Digital signature
More information about the openbmc