|
ROS 2 rclcpp + rcl - rolling
rolling-e7363f10
ROS 2 C++ Client Library with ROS Client Library
|


Classes | |
| struct | CallbackEventType |
| struct | CallbackGroupHandle |
| struct | ExecutableEntity |
| struct | ExecutableEntityWithInfo |
| struct | WaitableWithEventType |
Public Member Functions | |
| CBGScheduler (std::function< void()> sync_function) | |
| CBGScheduler (const CBGScheduler &)=delete | |
| CBGScheduler (CBGScheduler &&)=delete | |
| CBGScheduler & | operator= (const CBGScheduler &)=delete |
| CBGScheduler & | operator= (CBGScheduler &&)=delete |
| CallbackGroupHandle * | add_callback_group (const rclcpp::CallbackGroup::SharedPtr &callback_group) |
| void | remove_callback_group (const CallbackGroupHandle *callback_handle) |
| void | callback_group_ready (CallbackGroupHandle *handle, bool callback_group_was_idle) |
| ExecutableEntityWithInfo | get_next_ready_entity () |
| ExecutableEntityWithInfo | get_next_ready_entity (GlobalEventIdProvider::MonotonicId max_id) |
| virtual ExecutableEntityWithInfo | get_next_ready_entity_intern ()=0 |
| virtual ExecutableEntityWithInfo | get_next_ready_entity_intern (GlobalEventIdProvider::MonotonicId max_id)=0 |
| void | trigger_sync () |
| void | mark_entity_as_executed (const ExecutableEntity &e) |
| void | suppress_thread_wakeup () |
| void | unblock_one_worker_thread () |
| void | block_worker_thread (Worker *worker) |
| void | block_worker_thread_for (Worker *worker, std::chrono::nanoseconds timeout) |
| void | release_all_worker_threads () |
Protected Member Functions | |
| virtual std::unique_ptr< CallbackGroupHandle > | get_handle_for_callback_group (const rclcpp::CallbackGroup::SharedPtr &callback_group)=0 |
| bool | prepare_and_enqueue_worker (Worker *worker) |
Protected Attributes | |
| std::function< void()> | sync_function |
| bool | needs_sync = false |
| std::mutex | ready_callback_groups_mutex |
| std::deque< CallbackGroupHandle * > | ready_callback_groups |
| bool | worker_checking_for_work = false |
| WorkerQueue | worker_queue |
| std::list< std::unique_ptr< CallbackGroupHandle > > | callback_groups |
Definition at line 163 of file scheduler.hpp.
|
inlineexplicit |
| sync_function | A special purpose sync function, that shall be executed with high priority if triggered by trigger_sync(); |
Definition at line 326 of file scheduler.hpp.
|
inline |
Blocks the worker until work is available. Checking for work and registering as blocked happens atomically under the same lock that callback_group_ready / trigger_sync use to add work, so no wakeup can be lost in between. Returns immediately if work showed up, or if the worker queue was released.
Definition at line 508 of file scheduler.hpp.
References prepare_and_enqueue_worker().

|
inline |
Will be called, by CallbackGroupHandle if any entity in the cb group is ready for execution and the cb group was idle before
| callback_group_was_idle | Is false, if no entity of the callback group was executed, before this call was made. This means we need to wakeup a a new thread. |
Definition at line 367 of file scheduler.hpp.
References unblock_one_worker_thread().
Referenced by rclcpp::executors::cbg_executor::CBGScheduler::CallbackGroupHandle::add_ready_entity(), and rclcpp::executors::cbg_executor::CBGScheduler::CallbackGroupHandle::mark_as_executed().


|
inline |
Returns the next ready entity that shall be executed. If a entity is removed here, the scheduler may assume that it will be executed, and that the function mark_entity_as_executed will be called afterwards.
Definition at line 395 of file scheduler.hpp.
References get_next_ready_entity_intern().

|
pure virtual |
Will be called while holding the ready_callback_groups_mutex lock
Referenced by get_next_ready_entity().

|
inline |
Must be called, after a entity was executed. This function will normally be used, to mark the associated callback group as ready again.
Definition at line 461 of file scheduler.hpp.
References rclcpp::executors::cbg_executor::CBGScheduler::CallbackGroupHandle::mark_as_executed().

|
inlineprotected |
Returns true if the worker was enqueued and shall block. Returns false if there is work pending or the queue was released.
Definition at line 548 of file scheduler.hpp.
References rclcpp::executors::cbg_executor::WorkerQueue::push_blocked_worker_thread().
Referenced by block_worker_thread().


|
inline |
Suppresses the next thread wakeup. This is useful when we know that a thread is about to check for work anyway. In this case it would be harmful to wake another thread for nothing
Definition at line 473 of file scheduler.hpp.
|
inline |
If this function was triggered, a worker thread must be woken up, and the next call to get_next_ready_entity must return a ExecutableEntityWithInfo with the sync function in it.Or reworded if this function is triggered the sync function will be executed as the next exent by the executor.
Definition at line 441 of file scheduler.hpp.
References unblock_one_worker_thread().

|
inline |
Wakes up one blocked worker thread, unless a worker is already on its way to get_next_ready_entity(). The flag is only set if a worker was actually woken, otherwise no one would ever clear it.
Definition at line 484 of file scheduler.hpp.
References rclcpp::executors::cbg_executor::WorkerQueue::pop_blocked_worker_thread(), and rclcpp::executors::cbg_executor::Worker::unblock().
Referenced by callback_group_ready(), and trigger_sync().

