Struct SubscriptionFactory

Struct Documentation

struct SubscriptionFactory

Factory containing a function used to create a Subscription<MessageT>.

This factory class is used to encapsulate the template generated function which is used during the creation of a Message type specific subscription within a non-templated class.

It is created using the create_subscription_factory function, which is usually called from a templated “create_subscription” method of the Node class, and is passed to the non-templated “create_subscription” method of the NodeTopics class where it is used to create and setup the Subscription.

It also handles the two step construction of Subscriptions, first calling the constructor and then the post_init_setup() method.

Public Types

using SubscriptionFactoryFunction = std::function<rclcpp::SubscriptionBase::SharedPtr(rclcpp::node_interfaces::NodeBaseInterface *node_base, const std::string &topic_name, const rclcpp::QoS &qos)>

Public Members

const SubscriptionFactoryFunction create_typed_subscription