23 #ifndef PROTOBUFPUBSUBNODE20110506H 24 #define PROTOBUFPUBSUBNODE20110506H 26 #include "goby/common/pubsub_node_wrapper.h" 27 #include "protobuf_node.h" 28 #include <boost/function.hpp> 45 template <
typename ProtoBufMessage>
46 void subscribe(boost::function<
void(
const ProtoBufMessage&)> handler,
47 const std::string& group =
"")
51 glog.is(goby::common::logger::WARN) &&
52 glog <<
"Ignoring subscribe since we have `using_pubsub`=false" << std::endl;
55 node_.
subscribe<ProtoBufMessage>(SOCKET_SUBSCRIBE, handler, group);
common::FlexOstream glog
Access the Goby logger through this object.
The global namespace for the Goby project.
void subscribe(int socket_id, boost::function< void(const ProtoBufMessage &)> handler=boost::function< void(const ProtoBufMessage &)>(), const std::string &group="")
Subscribe to a message (of any type derived from google::protobuf::Message)