|
ROS 2 rclcpp + rcl - lyrical
lyrical
ROS 2 C++ Client Library with ROS Client Library
|
A class for managing a queue of timers. More...
Public Member Functions | |
| TimerQueue (rcl_clock_type_t timer_type, const rclcpp::Context::SharedPtr &context) | |
| void | stop () |
| void | remove_timer (const rclcpp::TimerBase::SharedPtr &timer) |
| Removes a new timer from the queue. This function is thread safe. More... | |
| void | add_timer (const rclcpp::TimerBase::SharedPtr &timer, const std::function< void(const std::function< void()> executed_cb)> &timer_ready_callback) |
| Adds a new timer to the queue. This function is thread safe. More... | |
A class for managing a queue of timers.
This class holds a queue of timers of one type (RCL_ROS_TIME, RCL_SYSTEM_TIME or RCL_STEADY_TIME). The queue itself manages an internal map of the timers, orders by the next time a timer will be ready. Each time a timer is ready, a callback will be called from the internal thread.
Definition at line 120 of file timer_manager.hpp.
|
inline |
Adds a new timer to the queue. This function is thread safe.
This function will ignore any timer, that has not a matching type
| timer | the timer to add. |
| timer_ready_callback | callback that should be called when the timer is ready. |
Definition at line 233 of file timer_manager.hpp.
References RCL_RET_OK, and rcl_timer_clock().

|
inline |
Removes a new timer from the queue. This function is thread safe.
Removes a timer, if it was added to this queue. Ignores timers that are not part of this queue
| timer | the timer to remove. |
Definition at line 176 of file timer_manager.hpp.
References RCL_RET_OK, and rcl_timer_clock().
