L4Re Operating System Framework – Interface and Usage Documentation
Loading...
Searching...
No Matches
L4::Poll_timeout_kipclock Class Reference

A polling timeout based on the L4Re clock. More...

#include <poll_timeout_kipclock>

+ Collaboration diagram for L4::Poll_timeout_kipclock:

Public Member Functions

 Poll_timeout_kipclock (unsigned poll_time_us)
 Initialise relative timeout in microseconds.
 
void set (unsigned poll_time_us)
 (Re-)Set relative timeout in microseconds
 
bool test (bool expression=true)
 Test whether timeout has expired.
 
bool timed_out () const
 Query whether timeout has expired.
 

Detailed Description

A polling timeout based on the L4Re clock.

This class allows to conveniently add a timeout to a polling loop.

The original

while (device.read(State) & Busy)
;

is converted to

Poll_timeout_kipclock timeout(10000);
while (timeout.test(device.read(State) & Busy))
;
if (timeout.timed_out())
printf("ERROR: Device does not respond.\n");
A polling timeout based on the L4Re clock.

Definition at line 38 of file poll_timeout_kipclock.

Constructor & Destructor Documentation

◆ Poll_timeout_kipclock()

L4::Poll_timeout_kipclock::Poll_timeout_kipclock ( unsigned  poll_time_us)
inline

Initialise relative timeout in microseconds.

Parameters
poll_time_usPolling timeout in microseconds.

Definition at line 45 of file poll_timeout_kipclock.

References set().

+ Here is the call graph for this function:

Member Function Documentation

◆ set()

void L4::Poll_timeout_kipclock::set ( unsigned  poll_time_us)
inline

(Re-)Set relative timeout in microseconds

Parameters
poll_time_usPolling timeout in microseconds.

Definition at line 54 of file poll_timeout_kipclock.

References l4_kip_clock(), and l4re_kip().

Referenced by Poll_timeout_kipclock().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ test()

bool L4::Poll_timeout_kipclock::test ( bool  expression = true)
inline

Test whether timeout has expired.

Parameters
expressionOptional expression.
Return values
falseThe timeout has expired or the given expression returned false.
trueThe timeout has not expired and the optionally given expression returns true.

Definition at line 68 of file poll_timeout_kipclock.

References l4_kip_clock(), and l4re_kip().

+ Here is the call graph for this function:

◆ timed_out()

bool L4::Poll_timeout_kipclock::timed_out ( ) const
inline

Query whether timeout has expired.

Returns
Expiry state of timeout

Definition at line 80 of file poll_timeout_kipclock.


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