15 #ifndef RCLCPP__PUBLISHER_FACTORY_HPP_
16 #define RCLCPP__PUBLISHER_FACTORY_HPP_
24 #include "rosidl_typesupport_cpp/message_type_support.hpp"
26 #include "rclcpp/publisher.hpp"
27 #include "rclcpp/publisher_base.hpp"
28 #include "rclcpp/publisher_options.hpp"
29 #include "rclcpp/node_interfaces/node_base_interface.hpp"
30 #include "rclcpp/qos.hpp"
31 #include "rclcpp/visibility_control.hpp"
53 using PublisherFactoryFunction = std::function<
54 rclcpp::PublisherBase::SharedPtr(
56 const std::string & topic_name,
60 const PublisherFactoryFunction create_typed_publisher;
64 template<
typename MessageT,
typename AllocatorT,
typename PublisherT>
72 const std::string & topic_name,
74 ) -> std::shared_ptr<PublisherT>
76 auto publisher = std::make_shared<PublisherT>(node_base, topic_name, qos, options);
80 publisher->post_init_setup(node_base, topic_name, qos, options);
Encapsulation of Quality of Service settings.
Pure virtual interface class for the NodeBase part of the Node API.
Versions of rosidl_typesupport_cpp::get_message_type_support_handle that handle adapted types.
PublisherFactory create_publisher_factory(const rclcpp::PublisherOptionsWithAllocator< AllocatorT > &options)
Return a PublisherFactory with functions setup for creating a PublisherT<MessageT,...
Factory with functions used to create a MessageT specific PublisherT.
Structure containing optional configuration for Publishers.