29 boost::signals2::connection c1, c2;
33 return std::tie(c1, c2);
43 unlink_from_publisher();
48 unlink_from_publisher();
49 if (is_configured()) subscribe_impl();
54 unlink_from_publisher();
55 if (is_configured()) unsubscribe_impl();
60 unlink_from_publisher();
61 if (is_configured()) link_with_publisher(pub);
72 unlink_from_publisher();
Base class for ROS publishers in a filter pipeline.
virtual ~SubscriberBase()
boost::signals2::signal< void()> disable_signal_
virtual void subscribe_on_demand(PublisherBase &pub)
Subscribe to the configured ROS topic whenever the given publisher is active.
virtual void subscribe()
Subscribe to the configured ROS topic.
Base class for ROS subscribers in a filter pipeline.
void update_subscriber_state()
Cause all linked subscribers to subscribe or unsubscribe to their ROS topics.
void link_with_publisher(PublisherBase &pub)
Add self to the list of subscribers which are controlled by a publisher.
virtual void unsubscribe()
Unsubscribe from the configured ROS topic.
void unlink_from_publisher()
Remove self from the list of subscribers which are controlled by a publisher.
virtual void unsubscribe_impl()=0
Implement how to unsubscribe from the configured ROS topic.
virtual void subscribe_impl()=0
Implement how to subscribe to the configured ROS topic.
boost::signals2::signal< void()> enable_signal_
std::tuple< boost::signals2::connection, boost::signals2::connection > link_with_subscriber(SubscriberBase &sub)
Add a new subscriber that will be controlled by this publisher.
virtual bool is_active() const =0
Check if the publisher is active.