35 #ifndef IMAGE_TRANSPORT_SINGLE_SUBSCRIBER_PUBLISHER
36 #define IMAGE_TRANSPORT_SINGLE_SUBSCRIBER_PUBLISHER
38 #include <boost/noncopyable.hpp>
39 #include <boost/function.hpp>
40 #include <sensor_msgs/Image.h>
52 typedef boost::function<uint32_t()> GetNumSubscribersFn;
53 typedef boost::function<void(
const sensor_msgs::Image&)> PublishFn;
55 SingleSubscriberPublisher(
const std::string& caller_id,
const std::string& topic,
56 const GetNumSubscribersFn& num_subscribers_fn,
57 const PublishFn& publish_fn);
59 std::string getSubscriberName()
const;
61 std::string getTopic()
const;
63 uint32_t getNumSubscribers()
const;
65 void publish(
const sensor_msgs::Image& message)
const;
66 void publish(
const sensor_msgs::ImageConstPtr& message)
const;
69 std::string caller_id_;
71 GetNumSubscribersFn num_subscribers_fn_;
72 PublishFn publish_fn_;
74 friend class Publisher;