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

Method createSdTimeEventSourceSlot

src/Connection.cpp:335–349  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

333}
334
335Slot Connection::createSdTimeEventSourceSlot(sd_event *event, int priority)
336{
337 sd_event_source *timeEventSource{};
338 auto r = sd_event_add_time(event, &timeEventSource, CLOCK_MONOTONIC, 0, 0, onSdTimerEvent, this);
339 SDBUS_THROW_ERROR_IF(r < 0, "Failed to add timer event", -r);
340 Slot sdTimeEventSource{timeEventSource, [](void* source){ deleteSdEventSource(static_cast<sd_event_source*>(source)); }};
341
342 r = sd_event_source_set_priority(timeEventSource, priority);
343 SDBUS_THROW_ERROR_IF(r < 0, "Failed to set time event priority", -r);
344
345 r = sd_event_source_set_description(timeEventSource, "bus-time");
346 SDBUS_THROW_ERROR_IF(r < 0, "Failed to set time event description", -r);
347
348 return sdTimeEventSource;
349}
350
351Slot Connection::createSdIoEventSourceSlot(sd_event *event, int fd, int priority) // NOLINT(bugprone-easily-swappable-parameters)
352{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected