24 #ifndef GOBY_MIDDLEWARE_TRANSPORT_PUBLISHER_H
25 #define GOBY_MIDDLEWARE_TRANSPORT_PUBLISHER_H
44 std::function<void(
const Data&,
const intervehicle::protobuf::AckData&)>;
46 std::function<void(
const Data&,
const intervehicle::protobuf::ExpireData&)>;
54 Publisher(
const goby::middleware::protobuf::TransporterConfig&
cfg =
55 goby::middleware::protobuf::TransporterConfig(),
60 set_group_func_(set_group_func),
65 if (acked_func_ && !cfg_.intervehicle().buffer().has_ack_required())
67 cfg_.mutable_intervehicle()->mutable_buffer()->set_ack_required(
true);
81 const goby::middleware::protobuf::TransporterConfig&
cfg()
const {
return cfg_; }
87 set_group_func_(data,
group);
98 goby::middleware::protobuf::TransporterConfig cfg_;
Class for grouping publications in the Goby middleware. Analogous to "topics" in ROS,...
Class that holds additional metadata and callback functions related to a publication (and is optional...
const goby::middleware::protobuf::TransporterConfig & cfg() const
Returns the metadata configuration.
std::function< void(const Data &, const intervehicle::protobuf::AckData &)> acked_func_type
acked_func_type acked_func() const
Returns the acked data callback (or an empty function if none is set)
bool has_set_group_func() const
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.
std::function< void(Data &, const Group &)> set_group_func_type
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.
std::function< void(const Data &, const intervehicle::protobuf::ExpireData &)> expired_func_type
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.
expired_func_type expired_func() const
Returns the expired data callback (or an empty function if none is set)
goby::util::logger::GroupSetter group(std::string n)
The global namespace for the Goby project.