Goby3
3.1.5a
2024.05.23
|
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>
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 45 of file subscriber.h.
using goby::middleware::Subscriber< Data >::subscribe_expired_func_type = typename Publisher<intervehicle::protobuf::Subscription>::expired_func_type |
Definition at line 43 of file subscriber.h.
using goby::middleware::Subscriber< Data >::subscribed_func_type = typename Publisher<intervehicle::protobuf::Subscription>::acked_func_type |
Definition at line 41 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.
|
inline |
Definition at line 77 of file subscriber.h.
|
inline |
Definition at line 80 of file subscriber.h.
|
inline |
Definition at line 83 of file subscriber.h.
|
inline |
Definition at line 96 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 99 of file subscriber.h.
|
inline |
Definition at line 94 of file subscriber.h.
|
inline |
Definition at line 92 of file subscriber.h.