00001 #ifndef THROTTLED_MESSAGE_TRANSPORT_SUBSCRIBER_H 00002 #define THROTTLED_MESSAGE_TRANSPORT_SUBSCRIBER_H 00003 00004 00005 #include <string> 00006 00007 #include <message_transport/simple_subscriber_plugin.h> 00008 #include <message_transport/raw_subscriber.h> 00009 00010 namespace throttled_transport { 00011 00012 template <class Base> 00013 class ThrottledSubscriber : public message_transport::SimpleSubscriberPlugin<Base,Base> 00014 { 00015 public: 00016 ThrottledSubscriber() { } 00017 00018 virtual ~ThrottledSubscriber() { 00019 } 00020 00021 virtual std::string getTransportName() const 00022 { 00023 return "throttled"; 00024 } 00025 protected: 00026 virtual void internalCallback(const typename Base::ConstPtr& message, 00027 const typename message_transport::SimpleSubscriberPlugin<Base,Base>::Callback& user_cb) 00028 { 00029 user_cb(message); 00030 } 00031 }; 00032 00033 } //namespace transport 00034 00035 #endif // THROTTLED_MESSAGE_TRANSPORT_SUBSCRIBER_H