|
nros C++ API
Lightweight ROS 2 client for embedded real-time systems (C++ headers)
|
#include <timer.hpp>
Public Member Functions | |
| Result | cancel () |
| bool | is_cancelled () const |
| Check if the timer is cancelled. | |
| bool | is_valid () const |
| Check if the timer is initialized and valid. | |
| Timer & | operator= (Timer &&other) |
| Result | reset () |
| Timer () | |
| Timer (Timer &&other) | |
| ~Timer () | |
| Destructor — cancels the timer. | |
Friends | |
| class | Node |
Repeating or one-shot timer registered with the executor.
Timers fire during spin_once() when their period has elapsed. The callback is a C function pointer with a user context.
Usage:
|
inline |
Destructor — cancels the timer.
|
inline |
|
inline |
Default constructor — creates an uninitialized timer. Use Node::create_timer() to initialize.
|
inline |
Cancel the timer. It stops firing but remains in the executor. Use reset() to restart it.
|
inline |
Check if the timer is cancelled.
|
inline |
Check if the timer is initialized and valid.
|
inline |
Reset the timer (restart from zero elapsed time). If cancelled, this also un-cancels it.