23 #ifndef Queue20080605H 24 #define Queue20080605H 35 #include <boost/algorithm/string.hpp> 36 #include <boost/any.hpp> 38 #include "goby/acomms/dccl/dccl.h" 39 #include "goby/common/time.h" 40 #include "goby/util/as.h" 42 #include "goby/acomms/acomms_helpers.h" 43 #include "goby/acomms/protobuf/queue.pb.h" 53 boost::shared_ptr<google::protobuf::Message> dccl_msg;
57 typedef std::list<QueuedMessage>::iterator messages_it;
58 typedef std::multimap<unsigned, messages_it>::iterator waiting_for_ack_it;
66 bool push_message(boost::shared_ptr<google::protobuf::Message> dccl_msg);
67 bool push_message(boost::shared_ptr<google::protobuf::Message> dccl_msg,
72 boost::any find_queue_field(
const std::string& field_name,
76 bool pop_message(
unsigned frame);
77 bool pop_message_ack(
unsigned frame, boost::shared_ptr<google::protobuf::Message>& removed_msg);
80 std::vector<boost::shared_ptr<google::protobuf::Message> > expire();
82 bool get_priority_values(
double* priority, boost::posix_time::ptime* last_send_time,
84 const std::string& data);
87 bool clear_ack_queue(
unsigned start_frame);
91 size_t size()
const {
return messages_.size(); }
93 boost::posix_time::ptime last_send_time()
const {
return last_send_time_; }
95 boost::posix_time::ptime newest_msg_time()
const 97 return size() ? goby::util::as<boost::posix_time::ptime>(messages_.back().meta.time())
98 : boost::posix_time::ptime();
101 void info(std::ostream* os)
const;
103 std::string name()
const {
return desc_->full_name(); }
114 const google::protobuf::Descriptor* descriptor()
const {
return desc_; }
119 waiting_for_ack_it find_ack_value(messages_it it_to_find);
120 messages_it next_message_it();
122 void set_latest_metadata(
const google::protobuf::FieldDescriptor* field,
123 const boost::any& field_value,
const boost::any& wire_value);
129 const google::protobuf::Descriptor* desc_;
134 std::map<protobuf::QueuedMessageEntry::RoleType, std::string> roles_;
136 boost::posix_time::ptime last_send_time_;
138 std::list<QueuedMessage> messages_;
142 std::multimap<unsigned, messages_it> waiting_for_ack_;
146 std::ostream& operator<<(std::ostream& os,
const Queue& oq);
provides an API to the goby-acomms Queuing Library.
static DCCLCodec * get()
DCCLCodec is a singleton class; use this to get a pointer to the class.
The global namespace for the Goby project.