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(wait_result_.reset();this->spinning.store(
false););
36 this->wait_result_.reset();
37 this->entities_need_rebuild_ =
true;
Coordinate the order and timing of available communication tasks.
RCLCPP_PUBLIC bool get_next_executable(AnyExecutable &any_executable, std::chrono::nanoseconds timeout=std::chrono::nanoseconds(-1))
Wait for executable in ready state and populate union structure.
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.