TickTimeouts are used to facilitate sequential function calls with timeout parameters that need to index from an initial start time and be proof against TimeTick rollover.
More...
#include <nbrtos.h>
|
| TickTimeout (uint32_t timeout) |
| Create and initialize the Timeout. More...
|
|
uint32_t | val () const |
| Get the timeout duration to be passed to a function utilizing timeout ticks. More...
|
|
bool | expired () const |
| Determine whether the timeout duration has elapsed. More...
|
|
| operator bool () const |
| Use the Timeout as a boolean (such as in a branch condition). Since the intention is to be used for 'while' or in a precondition check, the boolean value represents whether the duration is still valid and has not expired. As a result this is the express opposite behavior of the 'expired' method. More...
|
|
TickTimeouts are used to facilitate sequential function calls with timeout parameters that need to index from an initial start time and be proof against TimeTick rollover.
◆ TickTimeout()
TickTimeout::TickTimeout |
( |
uint32_t |
timeout | ) |
|
|
inlineexplicit |
Create and initialize the Timeout.
- Parameters
-
timeout | The maximum allowed time duration in ticks. Note: The maximum delay that can be used is INT32_MAX |
◆ expired()
bool TickTimeout::expired |
( |
| ) |
const |
|
inline |
Determine whether the timeout duration has elapsed.
- Return values
-
true | The timeout has expired |
false | The timeout has not expired |
◆ operator bool()
TickTimeout::operator bool |
( |
| ) |
const |
|
inline |
Use the Timeout as a boolean (such as in a branch condition). Since the intention is to be used for 'while' or in a precondition check, the boolean value represents whether the duration is still valid and has not expired. As a result this is the express opposite behavior of the 'expired' method.
- Return values
-
true | The Timeout duration is still valid |
false | The Timeout duration is expired |
◆ val()
uint32_t TickTimeout::val |
( |
| ) |
const |
|
inline |
Get the timeout duration to be passed to a function utilizing timeout ticks.
- Return values
-
uint32_t | The timeout duration |
The documentation for this class was generated from the following file: