ROS 2 rclcpp + rcl - lyrical  lyrical
ROS 2 C++ Client Library with ROS Client Library
single_threaded_executor.hpp
1 // Copyright 2014 Open Source Robotics Foundation, Inc.
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
15 #ifndef RCLCPP__EXECUTORS__SINGLE_THREADED_EXECUTOR_HPP_
16 #define RCLCPP__EXECUTORS__SINGLE_THREADED_EXECUTOR_HPP_
17 
18 #include <rmw/rmw.h>
19 
20 #include <cassert>
21 #include <cstdlib>
22 #include <memory>
23 #include <vector>
24 
25 #include "rclcpp/executor.hpp"
26 #include "rclcpp/macros.hpp"
27 #include "rclcpp/node.hpp"
28 #include "rclcpp/utilities.hpp"
29 #include "rclcpp/rate.hpp"
30 #include "rclcpp/visibility_control.hpp"
31 
32 namespace rclcpp
33 {
34 namespace executors
35 {
36 
38 
42 {
43 public:
44  RCLCPP_SMART_PTR_DEFINITIONS(SingleThreadedExecutor)
45 
46 
47  RCLCPP_PUBLIC
48  explicit SingleThreadedExecutor(
50 
52  RCLCPP_PUBLIC
53  virtual ~SingleThreadedExecutor();
54 
56 
63  RCLCPP_PUBLIC
64  void
65  spin() override;
66 
67 private:
68  RCLCPP_DISABLE_COPY(SingleThreadedExecutor)
69 };
70 
71 } // namespace executors
72 } // namespace rclcpp
73 
74 #endif // RCLCPP__EXECUTORS__SINGLE_THREADED_EXECUTOR_HPP_
Coordinate the order and timing of available communication tasks.
Definition: executor.hpp:65
Single-threaded executor implementation.
RCLCPP_PUBLIC SingleThreadedExecutor(const rclcpp::ExecutorOptions &options=rclcpp::ExecutorOptions())
Default constructor. See the default constructor for Executor.
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.
Options to be passed to the executor constructor.