|
Goby3 3.7.0
2026.11.12
|
Class that holds additional metadata and callback functions related to a subscription (and is optionally provided as a parameter to StaticTransporterInterface::subscribe). Use of this class is generally unnecessary on interprocess and inner layers. More...
#include <goby/middleware/transport/subscriber.h>
Classes | |
| struct | Options |
| Everything a Subscriber can be given, named, so that it can be initialized with C++20 designated initializers, e.g. More... | |
Public Types | |
| using | group_func_type = std::function< Group(const Data &)> |
| using | subscribed_func_type = typename Publisher< intervehicle::protobuf::Subscription >::acked_func_type |
| using | subscribe_expired_func_type = typename Publisher< intervehicle::protobuf::Subscription >::expired_func_type |
| using | set_link_data_func_type = std::function< void(Data &, const intervehicle::protobuf::Header &)> |
Class that holds additional metadata and callback functions related to a subscription (and is optionally provided as a parameter to StaticTransporterInterface::subscribe). Use of this class is generally unnecessary on interprocess and inner layers.
Definition at line 36 of file subscriber.h.
| using goby::middleware::Subscriber< Data >::group_func_type = std::function<Group(const Data&)> |
Definition at line 39 of file subscriber.h.
| using goby::middleware::Subscriber< Data >::set_link_data_func_type = std::function<void(Data&, const intervehicle::protobuf::Header&)> |
Definition at line 44 of file subscriber.h.
| using goby::middleware::Subscriber< Data >::subscribe_expired_func_type = typename Publisher<intervehicle::protobuf::Subscription>::expired_func_type |
Definition at line 42 of file subscriber.h.
| using goby::middleware::Subscriber< Data >::subscribed_func_type = typename Publisher<intervehicle::protobuf::Subscription>::acked_func_type |
Definition at line 40 of file subscriber.h.
|
inline |
Construct a Subscriber with all available metadata and callbacks.
| cfg | Additional metadata for this subscribe |
| group_func | Callback function for retrieving the group from a given data type if not provided in the parameters to the subscribe call. This is typically used when the group is defined or inferred from data in the message itself, and thus using this callback avoids duplicated data on the slow links used in the intervehicle and outer layers. |
| subscribed_func | Callback function for when a subscription request reaches a publisher for this data type |
| subscribe_expired_func | Callback function for when a subscription request expires without reaching any publishers (either because none exist or because the link(s) failed to transfer the request within the time to live). |
Definition at line 53 of file subscriber.h.
|
inline |
Construct a Subscriber but without the group_func callback.
Definition at line 68 of file subscriber.h.
|
inlineexplicit |
Construct a Subscriber from Options.
Definition at line 101 of file subscriber.h.
|
inline |
Definition at line 108 of file subscriber.h.
|
inline |
Definition at line 111 of file subscriber.h.
|
inline |
Definition at line 114 of file subscriber.h.
|
inline |
False if the group isn't stored in the message (see Options::group_in_message)
Definition at line 130 of file subscriber.h.
|
inline |
Definition at line 127 of file subscriber.h.
|
inline |
Sets the link data in the message using the set_link_data_func. Only intended to be called by the various transporters.
Definition at line 133 of file subscriber.h.
|
inline |
Definition at line 125 of file subscriber.h.
|
inline |
Definition at line 123 of file subscriber.h.