25 #ifndef GOBY_ACOMMS_QUEUE_QUEUE_MANAGER_H
26 #define GOBY_ACOMMS_QUEUE_QUEUE_MANAGER_H
36 #include <boost/signals2/signal.hpp>
37 #include <google/protobuf/descriptor.h>
55 class ModemTransmission;
88 template <
typename ProtobufMessage>
91 add_queue(ProtobufMessage::descriptor(), queue_cfg);
95 void add_queue(
const google::protobuf::Descriptor* desc,
152 void info_all(std::ostream* os)
const;
158 template <
typename ProtobufMessage>
void info(std::ostream* os)
const
160 info(ProtobufMessage::descriptor(), os);
164 void info(
const google::protobuf::Descriptor* desc, std::ostream* os)
const;
172 std::string
msg_string(
const google::protobuf::Descriptor* desc)
174 return desc->full_name() +
" (" + goby::util::as<std::string>(codec_->id(desc)) +
")";
182 unsigned dccl_id = codec_->id(
msg.GetDescriptor());
183 if (!queues_.count(dccl_id))
187 return queues_[dccl_id]->meta_from_msg(
msg);
218 signal_data_on_demand;
241 void qsize(
Queue* q);
245 bool first_user_frame);
256 std::string encode_repeated(
const std::list<QueuedMessage>& msgs);
257 std::list<QueuedMessage> decode_repeated(
const std::string& orig_bytes);
258 unsigned size_repeated(
const std::list<QueuedMessage>& msgs);
263 std::map<unsigned, std::shared_ptr<Queue> > queues_;
267 std::multimap<unsigned, Queue*> waiting_for_ack_;
270 unsigned packet_ack_{0};
274 std::set<ModemId> network_ack_src_ids_;
275 std::set<ModemId> route_additional_modem_ids_;
278 std::map<ModemId, std::string> encrypt_rules_;
280 protobuf::QueueManagerConfig cfg_;
284 std::string glog_push_group_;
285 std::string glog_pop_group_;
286 std::string glog_priority_group_;
287 std::string glog_out_group_;
288 std::string glog_in_group_;
292 class ManipulatorManager
297 manips_.insert(std::make_pair(
id, manip));
303 std::multimap<unsigned int, goby::acomms::protobuf::Manipulator>::const_iterator;
304 std::pair<iterator, iterator> p = manips_.equal_range(
id);
306 for (
auto it = p.first; it != p.second; ++it)
308 if (it->second == manip)
315 void clear() { manips_.clear(); }
320 std::multimap<unsigned, goby::acomms::protobuf::Manipulator> manips_;
323 ManipulatorManager manip_manager_;
327 std::ostream&
operator<<(std::ostream& out,
const QueueManager& d);