Goby3
3.1.5a
2024.05.23
|
Class that holds additional metadata and callback functions related to a publication (and is optionally provided as a parameter to StaticTransporterInterface::publish). Use of this class is generally unnecessary on interprocess and inner layers. More...
#include <goby/middleware/transport/intervehicle/driver_thread.h>
Public Types | |
using | set_group_func_type = std::function< void(Data &, const Group &)> |
using | acked_func_type = std::function< void(const Data &, const intervehicle::protobuf::AckData &)> |
using | expired_func_type = std::function< void(const Data &, const intervehicle::protobuf::ExpireData &)> |
Public Member Functions | |
Publisher (const goby::middleware::protobuf::TransporterConfig &cfg=goby::middleware::protobuf::TransporterConfig(), set_group_func_type set_group_func=set_group_func_type(), acked_func_type acked_func=acked_func_type(), expired_func_type expired_func=expired_func_type()) | |
Construct a Publisher with all available metadata and callbacks. More... | |
Publisher (const goby::middleware::protobuf::TransporterConfig &cfg, acked_func_type acked_func, expired_func_type expired_func=expired_func_type()) | |
Construct a Publisher but without the set_group_func callback. More... | |
~Publisher () | |
const goby::middleware::protobuf::TransporterConfig & | cfg () const |
Returns the metadata configuration. More... | |
void | set_group (Data &data, const Group &group) const |
Sets the group using the set_group_func. Only intended to be called by the various transporters. More... | |
acked_func_type | acked_func () const |
Returns the acked data callback (or an empty function if none is set) More... | |
expired_func_type | expired_func () const |
Returns the expired data callback (or an empty function if none is set) More... | |
bool | has_set_group_func () const |
Class that holds additional metadata and callback functions related to a publication (and is optionally provided as a parameter to StaticTransporterInterface::publish). Use of this class is generally unnecessary on interprocess and inner layers.
Definition at line 69 of file driver_thread.h.
using goby::middleware::Publisher< Data >::acked_func_type = std::function<void(const Data&, const intervehicle::protobuf::AckData&)> |
Definition at line 44 of file publisher.h.
using goby::middleware::Publisher< Data >::expired_func_type = std::function<void(const Data&, const intervehicle::protobuf::ExpireData&)> |
Definition at line 46 of file publisher.h.
using goby::middleware::Publisher< Data >::set_group_func_type = std::function<void(Data&, const Group&)> |
Definition at line 42 of file publisher.h.
|
inline |
Construct a Publisher with all available metadata and callbacks.
cfg | Additional metadata for all publish calls for which this Publisher is provided |
set_group_func | Callback function for setting the group for a given data type if not provided in the parameters to the publish 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 by setting the group value in the message contents itself (as opposed to transmitted in the header). |
acked_func | Callback function for when data is acknowledged by subscribers to this publication |
expired_func | Callback function for when data expires without reaching any subscribers (either because none exist or because the link(s) failed to transfer the data within the time to live). |
Definition at line 54 of file publisher.h.
|
inline |
Construct a Publisher but without the set_group_func callback.
Definition at line 72 of file publisher.h.
|
inline |
Definition at line 78 of file publisher.h.
|
inline |
Returns the acked data callback (or an empty function if none is set)
Definition at line 91 of file publisher.h.
|
inline |
Returns the metadata configuration.
Definition at line 81 of file publisher.h.
|
inline |
Returns the expired data callback (or an empty function if none is set)
Definition at line 93 of file publisher.h.
|
inline |
Definition at line 95 of file publisher.h.
|
inline |
Sets the group using the set_group_func. Only intended to be called by the various transporters.
Definition at line 84 of file publisher.h.