15 #include "rcpputils/scope_exit.hpp"
17 #include "rclcpp/executors/single_threaded_executor.hpp"
18 #include "rclcpp/any_executable.hpp"
31 throw std::runtime_error(
"spin() called while already spinning");
33 RCPPUTILS_SCOPE_EXIT(this->
spinning.store(
false); );
36 if (get_next_executable(any_executable)) {
Coordinate the order and timing of available communication tasks.
std::shared_ptr< rclcpp::Context > context_
The context associated with this executor.
RCLCPP_PUBLIC void execute_any_executable(AnyExecutable &any_exec)
Find the next available executable and do the work associated with it.
std::atomic_bool spinning
Spinning state, used to prevent multi threaded calls to spin and to cancel blocking spins.
Single-threaded executor implementation.
virtual RCLCPP_PUBLIC ~SingleThreadedExecutor()
Default destructor.
RCLCPP_PUBLIC void spin() override
Single-threaded implementation of spin.
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
RCLCPP_PUBLIC bool ok(rclcpp::Context::SharedPtr context=nullptr)
Check rclcpp's status.
Options to be passed to the executor constructor.