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  virtual
46  ~NodeTopics();
47 
49  virtual
50  rclcpp::PublisherBase::SharedPtr
52  const std::string & topic_name,
53  const rclcpp::PublisherFactory & publisher_factory,
54  rcl_publisher_options_t & publisher_options,
55  bool use_intra_process);
56 
58  virtual
59  void
61  rclcpp::PublisherBase::SharedPtr publisher);
62 
64  virtual
65  rclcpp::SubscriptionBase::SharedPtr
67  const std::string & topic_name,
68  const rclcpp::SubscriptionFactory & subscription_factory,
69  rcl_subscription_options_t & subscription_options,
70  bool use_intra_process);
71 
73  virtual
74  void
76  rclcpp::SubscriptionBase::SharedPtr subscription,
77  rclcpp::callback_group::CallbackGroup::SharedPtr callback_group);
78 
79 private:
81 
82  NodeBaseInterface * node_base_;
83 };
84 
85 } // namespace node_interfaces
86 } // namespace rclcpp
87 
88 #endif // RCLCPP__NODE_INTERFACES__NODE_TOPICS_HPP_
#define RCLCPP_DISABLE_COPY(...)
Definition: macros.hpp:26
#define RCLCPP_SMART_PTR_ALIASES_ONLY(...)
Definition: macros.hpp:66
Factory with functions used to create a MessageT specific PublisherT.
Definition: publisher_factory.hpp:45
Definition: allocator_common.hpp:24
virtual void add_publisher(rclcpp::PublisherBase::SharedPtr publisher)
NodeTopics(rclcpp::node_interfaces::NodeBaseInterface *node_base)
virtual void add_subscription(rclcpp::SubscriptionBase::SharedPtr subscription, rclcpp::callback_group::CallbackGroup::SharedPtr callback_group)
Pure virtual interface class for the NodeTopics part of the Node API.
Definition: node_topics_interface.hpp:38
Implementation of the NodeTopics part of the Node API.
Definition: node_topics.hpp:36
#define RCLCPP_PUBLIC
Definition: visibility_control.hpp:50
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:46
virtual rclcpp::SubscriptionBase::SharedPtr create_subscription(const std::string &topic_name, const rclcpp::SubscriptionFactory &subscription_factory, rcl_subscription_options_t &subscription_options, bool use_intra_process)
virtual rclcpp::PublisherBase::SharedPtr create_publisher(const std::string &topic_name, const rclcpp::PublisherFactory &publisher_factory, rcl_publisher_options_t &publisher_options, bool use_intra_process)