24 #ifndef GOBY_MIDDLEWARE_TRANSPORT_SUBSCRIBER_H
25 #define GOBY_MIDDLEWARE_TRANSPORT_SUBSCRIBER_H
45 std::function<void(Data&,
const intervehicle::protobuf::Header&)>;
54 goby::middleware::protobuf::TransporterConfig(),
60 group_func_(group_func),
63 set_link_data_func_(set_link_data_func)
80 const goby::middleware::protobuf::TransporterConfig&
cfg()
const {
return cfg_; }
86 return group_func_(data);
99 void set_link_data(Data& data,
const intervehicle::protobuf::Header& header)
const
101 if (set_link_data_func_)
102 set_link_data_func_(data, header);
106 goby::middleware::protobuf::TransporterConfig cfg_;
Class for grouping publications in the Goby middleware. Analogous to "topics" in ROS,...
static constexpr std::uint32_t broadcast_group
Special group number representing the broadcast group (used when no grouping is required for a given ...
Class that holds additional metadata and callback functions related to a publication (and is optional...
Class that holds additional metadata and callback functions related to a subscription (and is optiona...
const goby::middleware::protobuf::TransporterConfig & cfg() const
typename Publisher< intervehicle::protobuf::Subscription >::expired_func_type subscribe_expired_func_type
subscribed_func_type subscribed_func() const
Group group(const Data &data) const
bool has_group_func() const
Subscriber(const goby::middleware::protobuf::TransporterConfig &cfg=goby::middleware::protobuf::TransporterConfig(), group_func_type group_func=group_func_type(), subscribed_func_type subscribed_func=subscribed_func_type(), subscribe_expired_func_type subscribe_expired_func=subscribe_expired_func_type(), set_link_data_func_type set_link_data_func=set_link_data_func_type())
Construct a Subscriber with all available metadata and callbacks.
Subscriber(const goby::middleware::protobuf::TransporterConfig &cfg, subscribed_func_type subscribed_func, subscribe_expired_func_type subscribe_expired_func=subscribe_expired_func_type(), set_link_data_func_type set_link_data_func=set_link_data_func_type())
Construct a Subscriber but without the group_func callback.
subscribe_expired_func_type subscribe_expired_func() const
void set_link_data(Data &data, const intervehicle::protobuf::Header &header) const
Sets the link data in the message using the set_link_data_func. Only intended to be called by the var...
typename Publisher< intervehicle::protobuf::Subscription >::acked_func_type subscribed_func_type
std::function< void(Data &, const intervehicle::protobuf::Header &)> set_link_data_func_type
std::function< Group(const Data &)> group_func_type
The global namespace for the Goby project.