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_
23 #include "rcl/subscription.h"
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:79
Definition: subscription_base.hpp:59
std::shared_ptr< Allocator > get_allocator() const
Get the allocator, creating one if needed.
Definition: subscription_options.hpp:119
This header provides the get_node_base_interface() template function.
Definition: allocator_common.hpp:24
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:59
Definition: any_subscription_callback.hpp:37
const SubscriptionFactoryFunction create_typed_subscription
Definition: subscription_factory.hpp:63
void set(CallbackT callback)
Definition: any_subscription_callback.hpp:83
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