15 #ifndef RCLCPP__SUBSCRIPTION_FACTORY_HPP_ 16 #define RCLCPP__SUBSCRIPTION_FACTORY_HPP_ 25 #include "rosidl_typesupport_cpp/message_type_support.hpp" 51 rclcpp::SubscriptionBase::SharedPtr(
61 rclcpp::intra_process_manager::IntraProcessManager::SharedPtr ipm,
62 rclcpp::SubscriptionBase::SharedPtr subscription,
73 typename CallbackMessageT,
74 typename SubscriptionT>
77 CallbackT && callback,
80 CallbackMessageT, Alloc>::SharedPtr
88 any_subscription_callback.
set(std::forward<CallbackT>(callback));
91 std::make_shared<typename Subscription<CallbackMessageT, Alloc>::MessageAlloc>();
95 [allocator, msg_mem_strat, any_subscription_callback, event_callbacks, message_alloc](
99 ) -> rclcpp::SubscriptionBase::SharedPtr
101 auto options_copy = subscription_options;
102 options_copy.allocator =
103 rclcpp::allocator::get_rcl_allocator<CallbackMessageT>(*message_alloc.get());
109 node_base->get_shared_rcl_node_handle(),
110 *rosidl_typesupport_cpp::get_message_type_support_handle<MessageT>(),
113 any_subscription_callback,
126 #endif // RCLCPP__SUBSCRIPTION_FACTORY_HPP_ Default allocation strategy for messages received by subscriptions.
Definition: message_memory_strategy.hpp:40
This header provides the get_node_topics_interface() template function.
Definition: allocator_common.hpp:24
Subscription implementation, templated on the type of message this subscription receives.
Definition: subscription.hpp:59
Definition: any_subscription_callback.hpp:34
SubscriptionFactoryFunction create_typed_subscription
Definition: subscription_factory.hpp:56
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
T dynamic_pointer_cast(T... args)
SetupIntraProcessFunction setup_intra_process
Definition: subscription_factory.hpp:65
SubscriptionFactory create_subscription_factory(CallbackT &&callback, const SubscriptionEventCallbacks &event_callbacks, typename rclcpp::message_memory_strategy::MessageMemoryStrategy< CallbackMessageT, Alloc >::SharedPtr msg_mem_strat, std::shared_ptr< Alloc > allocator)
Return a SubscriptionFactory with functions for creating a SubscriptionT<MessageT, Alloc>.
Definition: subscription_factory.hpp:76
Definition: subscription_base.hpp:53
Contains callbacks for non-message events that a Subscription can receive from the middleware...
Definition: qos_event.hpp:49
void set(CallbackT callback)
Definition: any_subscription_callback.hpp:80