rclcpp  master
C++ ROS Client Library API
node_topics.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_HPP_
16 #define RCLCPP__NODE_INTERFACES__NODE_TOPICS_HPP_
17 
18 #include <string>
19 
20 #include "rcl/publisher.h"
21 #include "rcl/subscription.h"
22 
23 #include "rclcpp/macros.hpp"
26 #include "rclcpp/publisher.hpp"
29 
30 namespace rclcpp
31 {
32 namespace node_interfaces
33 {
34 
37 {
38 public:
40 
43 
45  ~NodeTopics() override;
46 
48  rclcpp::PublisherBase::SharedPtr
50  const std::string & topic_name,
51  const rclcpp::PublisherFactory & publisher_factory,
52  const rcl_publisher_options_t & publisher_options,
53  bool use_intra_process) override;
54 
56  void
58  rclcpp::PublisherBase::SharedPtr publisher,
59  rclcpp::callback_group::CallbackGroup::SharedPtr callback_group) override;
60 
62  rclcpp::SubscriptionBase::SharedPtr
64  const std::string & topic_name,
65  const rclcpp::SubscriptionFactory & subscription_factory,
66  const rcl_subscription_options_t & subscription_options,
67  bool use_intra_process) override;
68 
70  void
72  rclcpp::SubscriptionBase::SharedPtr subscription,
73  rclcpp::callback_group::CallbackGroup::SharedPtr callback_group) override;
74 
77  get_node_base_interface() const override;
78 
79 private:
80  RCLCPP_DISABLE_COPY(NodeTopics)
81 
83 };
84 
85 } // namespace node_interfaces
86 } // namespace rclcpp
87 
88 #endif // RCLCPP__NODE_INTERFACES__NODE_TOPICS_HPP_
void add_subscription(rclcpp::SubscriptionBase::SharedPtr subscription, rclcpp::callback_group::CallbackGroup::SharedPtr callback_group) override
#define RCLCPP_DISABLE_COPY(...)
Definition: macros.hpp:26
rclcpp::SubscriptionBase::SharedPtr create_subscription(const std::string &topic_name, const rclcpp::SubscriptionFactory &subscription_factory, const rcl_subscription_options_t &subscription_options, bool use_intra_process) override
#define RCLCPP_SMART_PTR_ALIASES_ONLY(...)
Definition: macros.hpp:66
rclcpp::node_interfaces::NodeBaseInterface * get_node_base_interface() const override
This header provides the get_node_topics_interface() template function.
Definition: allocator_common.hpp:24
Factory with functions used to create a MessageT specific PublisherT.
Definition: publisher_factory.hpp:45
void add_publisher(rclcpp::PublisherBase::SharedPtr publisher, rclcpp::callback_group::CallbackGroup::SharedPtr callback_group) override
NodeTopics(rclcpp::node_interfaces::NodeBaseInterface *node_base)
Pure virtual interface class for the NodeBase part of the Node API.
Definition: node_base_interface.hpp:36
Factory with functions used to create a Subscription<MessageT>.
Definition: subscription_factory.hpp:47
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
Pure virtual interface class for the NodeTopics part of the Node API.
Definition: node_topics_interface.hpp:38
rclcpp::PublisherBase::SharedPtr create_publisher(const std::string &topic_name, const rclcpp::PublisherFactory &publisher_factory, const rcl_publisher_options_t &publisher_options, bool use_intra_process) override
Implementation of the NodeTopics part of the Node API.
Definition: node_topics.hpp:36