Maintains next timeout for event polling loop. More...
#include <PollTimeout.h>
Public Member Functions | |
PollTimeout () | |
Constructor. More... | |
void | set (ClockT::time_point now, ClockT::time_point expire) |
Sets the next timeout. More... | |
void | set_indefinite () |
Sets the next timeout to be an indefinite time in the future. More... | |
int | get_millis () |
Gets duration until next timeout in the form of milliseconds. More... | |
struct timespec * | get_timespec () |
Gets duration until next timeout in the form of a pointer to timespec. More... | |
Private Attributes | |
struct timespec * | ts_ptr |
Pointer to to duration_ts or 0 if indefinite. More... | |
struct timespec | duration_ts |
timespec structure holding duration until next timeout More... | |
std::chrono::milliseconds | duration_millis {-1} |
Duration until next timeout in milliseconds. More... | |
Maintains next timeout for event polling loop.
This class is used to maintain and provide access to the next timeout for the event polling loops. It contains accessor methods to return the timeout in different formats required by the various polling interfaces.
Definition at line 44 of file PollTimeout.h.
|
inline |
Constructor.
Definition at line 49 of file PollTimeout.h.
|
inline |
Gets duration until next timeout in the form of milliseconds.
Definition at line 74 of file PollTimeout.h.
|
inline |
Gets duration until next timeout in the form of a pointer to timespec.
Definition at line 79 of file PollTimeout.h.
|
inline |
Sets the next timeout.
now | Current time |
expire | Absolute time of next timeout |
Definition at line 55 of file PollTimeout.h.
|
inline |
Sets the next timeout to be an indefinite time in the future.
Definition at line 66 of file PollTimeout.h.
|
private |
Duration until next timeout in milliseconds.
Definition at line 90 of file PollTimeout.h.
|
private |
timespec structure holding duration until next timeout
Definition at line 87 of file PollTimeout.h.
|
private |
Pointer to to duration_ts or 0 if indefinite.
Definition at line 84 of file PollTimeout.h.