rclcpp  master
C++ ROS Client Library API
node_topics_interface.hpp
Go to the documentation of this file.
1 // Copyright 2016 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__NODE_INTERFACES__NODE_TOPICS_INTERFACE_HPP_
16 #define RCLCPP__NODE_INTERFACES__NODE_TOPICS_INTERFACE_HPP_
17 
18 #include <functional>
19 #include <memory>
20 #include <string>
21 
22 #include "rcl/publisher.h"
23 #include "rcl/subscription.h"
24 
25 #include "rclcpp/macros.hpp"
26 #include "rclcpp/publisher.hpp"
28 #include "rclcpp/subscription.hpp"
31 
32 namespace rclcpp
33 {
34 namespace node_interfaces
35 {
36 
39 {
40 public:
42 
44  virtual
45  ~NodeTopicsInterface() = default;
46 
48  virtual
51  const std::string & topic_name,
52  const rclcpp::PublisherFactory & publisher_factory,
53  const rclcpp::QoS & qos) = 0;
54 
56  virtual
57  void
60  rclcpp::callback_group::CallbackGroup::SharedPtr callback_group) = 0;
61 
63  virtual
66  const std::string & topic_name,
67  const rclcpp::SubscriptionFactory & subscription_factory,
68  const rclcpp::QoS & qos) = 0;
69 
71  virtual
72  void
75  rclcpp::callback_group::CallbackGroup::SharedPtr callback_group) = 0;
76 
78  virtual
80  get_node_base_interface() const = 0;
81 };
82 
83 } // namespace node_interfaces
84 } // namespace rclcpp
85 
86 #endif // RCLCPP__NODE_INTERFACES__NODE_TOPICS_INTERFACE_HPP_
Encapsulation of Quality of Service settings.
Definition: qos.hpp:55
#define RCLCPP_SMART_PTR_ALIASES_ONLY(...)
Definition: macros.hpp:66
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
virtual rclcpp::node_interfaces::NodeBaseInterface * get_node_base_interface() const =0
Factory with functions used to create a MessageT specific PublisherT.
Definition: publisher_factory.hpp:50
Pure virtual interface class for the NodeBase part of the Node API.
Definition: node_base_interface.hpp:36
Factory containing a function used to create a Subscription<MessageT>.
Definition: subscription_factory.hpp:53
virtual void add_subscription(rclcpp::SubscriptionBase::SharedPtr subscription, rclcpp::callback_group::CallbackGroup::SharedPtr callback_group)=0
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
Set the data type used in the intra-process buffer as std::shared_ptr<MessageT>
Pure virtual interface class for the NodeTopics part of the Node API.
Definition: node_topics_interface.hpp:38
virtual void add_publisher(rclcpp::PublisherBase::SharedPtr publisher, rclcpp::callback_group::CallbackGroup::SharedPtr callback_group)=0
virtual rclcpp::PublisherBase::SharedPtr create_publisher(const std::string &topic_name, const rclcpp::PublisherFactory &publisher_factory, const rclcpp::QoS &qos)=0
virtual rclcpp::SubscriptionBase::SharedPtr create_subscription(const std::string &topic_name, const rclcpp::SubscriptionFactory &subscription_factory, const rclcpp::QoS &qos)=0