Go to the documentation of this file.
25 #ifndef GOBY_ACOMMS_QUEUE_QUEUE_H
26 #define GOBY_ACOMMS_QUEUE_QUEUE_H
36 #include <boost/any.hpp>
37 #include <boost/date_time/posix_time/posix_time_config.hpp>
38 #include <boost/date_time/posix_time/ptime.hpp>
39 #include <boost/units/quantity.hpp>
40 #include <google/protobuf/descriptor.h>
61 class ModemTransmission;
66 std::shared_ptr<google::protobuf::Message>
dccl_msg;
79 bool push_message(
const std::shared_ptr<google::protobuf::Message>& dccl_msg);
80 bool push_message(
const std::shared_ptr<google::protobuf::Message>& dccl_msg,
90 bool pop_message_ack(
unsigned frame, std::shared_ptr<google::protobuf::Message>& removed_msg);
93 std::vector<std::shared_ptr<google::protobuf::Message> >
expire();
97 const std::string& data);
104 size_t size()
const {
return messages_.size(); }
110 return size() ? goby::time::convert<boost::posix_time::ptime>(
111 messages_.back().meta.time_with_units())
112 : boost::posix_time::ptime();
115 void info(std::ostream* os)
const;
117 std::string
name()
const {
return desc_->full_name(); }
128 const google::protobuf::Descriptor*
descriptor()
const {
return desc_; }
136 void set_latest_metadata(
const google::protobuf::FieldDescriptor*
field,
137 const boost::any& field_value,
const boost::any& wire_value);
139 double time_duration2double(
const boost::posix_time::time_duration& time_of_day);
145 const google::protobuf::Descriptor* desc_;
150 std::map<protobuf::QueuedMessageEntry::RoleType, std::string> roles_;
152 boost::posix_time::ptime last_send_time_;
154 std::list<QueuedMessage> messages_;
158 std::multimap<unsigned, messages_it> waiting_for_ack_;
162 std::ostream&
operator<<(std::ostream& os,
const Queue& oq);
bool pop_message(unsigned frame)
const protobuf::QueuedMessageEntry & queue_message_options()
The global namespace for the Goby project.
boost::posix_time::ptime last_send_time() const
std::shared_ptr< google::protobuf::Message > dccl_msg
protobuf::QueuedMessageMeta meta
void set_cfg(const protobuf::QueuedMessageEntry &cfg)
void info(std::ostream *os) const
void stream_for_pop(const QueuedMessage &queued_msg)
static DCCLCodec * get()
DCCLCodec is a singleton class; use this to get a pointer to the class.
std::multimap< unsigned int, messages_it >::iterator waiting_for_ack_it
std::ostream & operator<<(std::ostream &os, const MACManager &mac)
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::FieldOptions, ::google::protobuf::internal::MessageTypeTraits< ::goby::GobyFieldOptions >, 11, false > field
bool get_priority_values(double *priority, boost::posix_time::ptime *last_send_time, const protobuf::ModemTransmission &request_msg, const std::string &data)
protobuf::QueuedMessageMeta meta_from_msg(const google::protobuf::Message &dccl_msg)
Queue(const google::protobuf::Descriptor *desc, QueueManager *parent, protobuf::QueuedMessageEntry cfg=protobuf::QueuedMessageEntry())
extern ::google::protobuf::internal::ExtensionIdentifier< ::google::protobuf::MessageOptions, ::google::protobuf::internal::MessageTypeTraits< ::goby::GobyMessageOptions >, 11, false > msg
goby::acomms::QueuedMessage give_data(unsigned frame)
std::vector< std::shared_ptr< google::protobuf::Message > > expire()
provides an API to the goby-acomms Queuing Library.
bool pop_message_ack(unsigned frame, std::shared_ptr< google::protobuf::Message > &removed_msg)
std::list< QueuedMessage >::iterator messages_it
bool clear_ack_queue(unsigned start_frame)
boost::any find_queue_field(const std::string &field_name, const google::protobuf::Message &msg)
bool push_message(const std::shared_ptr< google::protobuf::Message > &dccl_msg)
const google::protobuf::Descriptor * descriptor() const
boost::posix_time::ptime newest_msg_time() const