16 #ifndef RCLCPP__GENERIC_PUBLISHER_HPP_
17 #define RCLCPP__GENERIC_PUBLISHER_HPP_
22 #include "rcpputils/shared_library.hpp"
24 #include "rclcpp/callback_group.hpp"
25 #include "rclcpp/macros.hpp"
26 #include "rclcpp/node_interfaces/node_base_interface.hpp"
27 #include "rclcpp/node_interfaces/node_topics_interface.hpp"
28 #include "rclcpp/publisher_base.hpp"
29 #include "rclcpp/qos.hpp"
30 #include "rclcpp/serialized_message.hpp"
31 #include "rclcpp/typesupport_helpers.hpp"
32 #include "rclcpp/visibility_control.hpp"
69 template<
typename AllocatorT = std::allocator<
void>>
72 std::shared_ptr<rcpputils::SharedLibrary> ts_lib,
73 const std::string & topic_name,
74 const std::string & topic_type,
83 options.event_callbacks,
84 options.use_default_callbacks),
106 std::shared_ptr<rcpputils::SharedLibrary> ts_lib_;
108 void * borrow_loaned_message();
109 void deserialize_message(
110 const rmw_serialized_message_t & serialized_message,
111 void * deserialized_msg);
112 void publish_loaned_message(
void * loaned_message);
Publisher for serialized messages whose type is not known at compile time.
RCLCPP_PUBLIC void publish(const rclcpp::SerializedMessage &message)
Publish a rclcpp::SerializedMessage.
GenericPublisher(rclcpp::node_interfaces::NodeBaseInterface *node_base, std::shared_ptr< rcpputils::SharedLibrary > ts_lib, const std::string &topic_name, const std::string &topic_type, const rclcpp::QoS &qos, const rclcpp::PublisherOptionsWithAllocator< AllocatorT > &options)
Constructor.
RCLCPP_PUBLIC void publish_as_loaned_msg(const rclcpp::SerializedMessage &message)
Encapsulation of Quality of Service settings.
Object oriented version of rcl_serialized_message_t with destructor to avoid memory leaks.
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.
RCLCPP_PUBLIC const rosidl_message_type_support_t * get_message_typesupport_handle(const std::string &type, const std::string &typesupport_identifier, rcpputils::SharedLibrary &library)
Extracts the message type support handle from the library.
Structure containing optional configuration for Publishers.