sdbus-c++ 2.0.0
High-level C++ D-Bus library based on systemd D-Bus implementation
Loading...
Searching...
No Matches
sdbus::IConnection::PollData Struct Reference

#include <IConnection.h>

Public Member Functions

std::chrono::microseconds getRelativeTimeout () const
 
int getPollTimeout () const
 

Public Attributes

int fd
 
short int events
 
std::chrono::microseconds timeout
 
int eventFd
 

Detailed Description

Carries poll data needed for integration with external event loop implementations.

See getEventLoopPollData() for more info.

Member Function Documentation

◆ getPollTimeout()

int sdbus::IConnection::PollData::getPollTimeout ( ) const
nodiscard

Returns relative timeout in the form which can be passed as argument 'timeout' to poll(2)

Returns
-1 if the timeout is indefinite. 0 if the poll(2) shouldn't block. An integer in milliseconds otherwise.

◆ getRelativeTimeout()

std::chrono::microseconds sdbus::IConnection::PollData::getRelativeTimeout ( ) const
nodiscard

Returns the timeout as relative value from now.

Returned value is std::chrono::microseconds::max() if the timeout is indefinite.

Returns
Relative timeout as a time duration

Member Data Documentation

◆ eventFd

int sdbus::IConnection::PollData::eventFd

An additional event fd to be monitored by the event loop for POLLIN events.

◆ events

short int sdbus::IConnection::PollData::events

The events to use for poll(2) alongside fd.

◆ fd

int sdbus::IConnection::PollData::fd

The read fd to be monitored by the event loop.

◆ timeout

std::chrono::microseconds sdbus::IConnection::PollData::timeout

Absolute timeout value in microseconds, based of CLOCK_MONOTONIC.

Call getPollTimeout() to get timeout recalculated to relative timeout that can be passed to poll(2).


The documentation for this struct was generated from the following file: