Go to the documentation of this file.
24 #ifndef GOBY_MIDDLEWARE_TRANSPORT_SUBSCRIBER_H
25 #define GOBY_MIDDLEWARE_TRANSPORT_SUBSCRIBER_H
60 group_func_(group_func),
63 set_link_data_func_(set_link_data_func)
86 return group_func_(data);
101 if (set_link_data_func_)
102 set_link_data_func_(data, header);
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.
The global namespace for the Goby project.
Class that holds additional metadata and callback functions related to a subscription (and is optiona...
Group group(const Data &data) const
std::function< Group(const Data &)> group_func_type
subscribe_expired_func_type subscribe_expired_func() const
std::function< void(Data &, const intervehicle::protobuf::Header &)> set_link_data_func_type
Class that holds additional metadata and callback functions related to a publication (and is optional...
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.
bool has_group_func() const
typename Publisher< intervehicle::protobuf::Subscription >::expired_func_type subscribe_expired_func_type
const goby::middleware::protobuf::TransporterConfig & cfg() const
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 ...
typename Publisher< intervehicle::protobuf::Subscription >::acked_func_type subscribed_func_type
subscribed_func_type subscribed_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...