rclcpp
master
C++ ROS Client Library API
|
Go to the documentation of this file.
15 #ifndef RCLCPP__SUBSCRIPTION_FACTORY_HPP_
16 #define RCLCPP__SUBSCRIPTION_FACTORY_HPP_
25 #include "rosidl_typesupport_cpp/message_type_support.hpp"
58 rclcpp::SubscriptionBase::SharedPtr(
77 typename CallbackMessageT =
86 CallbackT && callback,
88 typename MessageMemoryStrategyT::SharedPtr msg_mem_strat,
90 subscription_topic_stats =
nullptr
97 any_subscription_callback.
set(std::forward<CallbackT>(callback));
101 [options, msg_mem_strat, any_subscription_callback, subscription_topic_stats](
105 ) -> rclcpp::SubscriptionBase::SharedPtr
112 *rosidl_typesupport_cpp::get_message_type_support_handle<MessageT>(),
115 any_subscription_callback,
118 subscription_topic_stats);
122 sub->post_init_setup(node_base, qos, options);
123 auto sub_base_ptr = std::dynamic_pointer_cast<SubscriptionBase>(sub);
134 #endif // RCLCPP__SUBSCRIPTION_FACTORY_HPP_
Definition: subscription_topic_statistics.hpp:55
SubscriptionFactory create_subscription_factory(CallbackT &&callback, const rclcpp::SubscriptionOptionsWithAllocator< AllocatorT > &options, typename MessageMemoryStrategyT::SharedPtr msg_mem_strat, std::shared_ptr< rclcpp::topic_statistics::SubscriptionTopicStatistics< CallbackMessageT >> subscription_topic_stats=nullptr)
Return a SubscriptionFactory setup to create a SubscriptionT<MessageT, AllocatorT>.
Definition: subscription_factory.hpp:85
Structure containing optional configuration for Subscriptions.
Definition: subscription_options.hpp:87
Definition: subscription_base.hpp:60
std::shared_ptr< Allocator > get_allocator() const
Get the allocator, creating one if needed.
Definition: subscription_options.hpp:129
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
AnySubscriptionCallback< MessageT, AllocatorT > set(CallbackT callback)
Generic function for setting the callback.
Definition: any_subscription_callback.hpp:158
Subscription implementation, templated on the type of message this subscription receives.
Definition: subscription.hpp:69
Pure virtual interface class for the NodeBase part of the Node API.
Definition: node_base_interface.hpp:36
Encapsulation of Quality of Service settings.
Definition: qos.hpp:110
Definition: any_subscription_callback.hpp:101
const SubscriptionFactoryFunction create_typed_subscription
Definition: subscription_factory.hpp:63
Factory containing a function used to create a Subscription<MessageT>.
Definition: subscription_factory.hpp:54
Default allocation strategy for messages received by subscriptions.
Definition: message_memory_strategy.hpp:41