MCPcopy Create free account
hub / github.com/Kistler-Group/sdbus-cpp / registerSignalHandler

Method registerSignalHandler

src/Connection.cpp:619–641  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

617}
618
619Slot Connection::registerSignalHandler( const char* sender
620 , const char* objectPath
621 , const char* interfaceName
622 , const char* signalName
623 , sd_bus_message_handler_t callback
624 , void* userData
625 , return_slot_t )
626{
627 sd_bus_slot *slot{};
628
629 auto r = sdbus_->sd_bus_match_signal( bus_.get()
630 , &slot
631 , *sender == '\0' ? nullptr : sender
632 , *objectPath == '\0' ? nullptr : objectPath
633 , *interfaceName == '\0' ? nullptr : interfaceName
634 , *signalName == '\0' ? nullptr : signalName
635 , callback
636 , userData );
637
638 SDBUS_THROW_ERROR_IF(r < 0, "Failed to register signal handler", -r);
639
640 return {slot, [this](void *slot){ sdbus_->sd_bus_slot_unref(static_cast<sd_bus_slot*>(slot)); }};
641}
642
643sd_bus_message* Connection::incrementMessageRefCount(sd_bus_message* sdbusMsg)
644{

Callers

nothing calls this directly

Calls 3

sd_bus_match_signalMethod · 0.80
sd_bus_slot_unrefMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected