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

Method processPendingEvent

src/Connection.cpp:813–828  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

811}
812
813bool Connection::processPendingEvent()
814{
815 auto *bus = bus_.get();
816 assert(bus != nullptr);
817
818 const int r = sdbus_->sd_bus_process(bus, nullptr);
819 SDBUS_THROW_ERROR_IF(r < 0, "Failed to process bus requests", -r);
820
821 // In correct use of sdbus-c++ API, r can be 0 only when processPendingEvent()
822 // is called from an external event loop as a reaction to event fd being signalled.
823 // If there are no more D-Bus messages to process, we know we have to clear event fd.
824 if (r == 0)
825 eventFd_.clear();
826
827 return r > 0;
828}
829
830bool Connection::waitForNextEvent() // NOLINT(misc-no-recursion)
831{

Callers 2

onSdTimerEventMethod · 0.80
onSdIoEventMethod · 0.80

Calls 3

sd_bus_processMethod · 0.80
getMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected