29 #ifndef SWRI_ROSCPP_OPTIONAL_SUBSCRIBER_H_ 30 #define SWRI_ROSCPP_OPTIONAL_SUBSCRIBER_H_ 52 template<
class M,
class T>
65 const std::string &
name,
73 queue_size_ = queue_size;
76 transport_hints_ = transport_hints;
81 return swri::Subscriber(nh_, name_, queue_size_, callback_, obj_, transport_hints_);
94 template<
class T,
class M>
101 ptr->
initialize(nh, topic, queue_size, fp, obj, transport_hints);
109 ROS_ERROR(
"Called subscribe on uninitialized optional subscriber");
112 sub_ = impl_->subscribe();
127 #endif // SWRI_ROSCPP_OPTIONAL_SUBSCRIBER_H_
virtual swri::Subscriber subscribe()=0
int numPublishers() const
void initialize(ros::NodeHandle &nh, const std::string &name, uint32_t queue_size, void(T::*cb)(const boost::shared_ptr< M const > &), T *obj, const ros::TransportHints &transport_hints)
OptionalSubscriber(ros::NodeHandle &nh, std::string topic, uint32_t queue_size, void(T::*fp)(const boost::shared_ptr< M const > &), T *obj, const ros::TransportHints &transport_hints=ros::TransportHints())
virtual ~OptionalSubscriberImplRoot()
boost::shared_ptr< OptionalSubscriberImplRoot > impl_
virtual swri::Subscriber subscribe()
ros::TransportHints transport_hints_