Goby3
3.1.5a
2024.05.23
|
provides an API to the goby-acomms Queuing Library. More...
#include <goby/acomms/queue.h>
Public Member Functions | |
QueueManager () | |
constructor More... | |
~QueueManager ()=default | |
destructor More... | |
Initialization Methods | |
These methods are intended to be called before doing any work with the class. | |
void | set_cfg (const protobuf::QueueManagerConfig &cfg) |
Set (and overwrite completely if present) the current configuration. (protobuf::QueueManagerConfig defined in acomms_queue.proto) More... | |
void | merge_cfg (const protobuf::QueueManagerConfig &cfg) |
Set (and merge "repeat" fields) the current configuration. (protobuf::QueueManagerConfig defined in acomms_queue.proto) More... | |
template<typename ProtobufMessage > | |
void | add_queue (const protobuf::QueuedMessageEntry &queue_cfg) |
Add a DCCL queue for use with QueueManager. Note that the queue must be added before receiving messages with QueueManager. More... | |
void | add_queue (const google::protobuf::Descriptor *desc, const protobuf::QueuedMessageEntry &queue_cfg) |
Alternative method for adding Queues when using Dynamic Protobuf Messages. More... | |
Application level Push/Receive Methods | |
These methods are the primary higher level interface to the QueueManager. From here you can push messages and set the callbacks to use on received messages. | |
void | push_message (const google::protobuf::Message &new_message) |
Push a message (and add the queue if it does not exist) More... | |
void | push_message (const google::protobuf::Message &new_message, const protobuf::QueuedMessageMeta *meta) |
void | flush_queue (const protobuf::QueueFlush &flush) |
Flush (delete all messages in) a queue. More... | |
Modem Slots | |
These methods are the interface to the QueueManager from the modem driver. | |
void | handle_modem_data_request (protobuf::ModemTransmission *msg) |
Finds data to send to the modem. More... | |
void | handle_modem_receive (const protobuf::ModemTransmission &message) |
Receive incoming data from the modem. More... | |
Control | |
Call these methods when you want the QueueManager to perform time sensitive tasks (such as expiring old messages) | |
void | do_work () |
Calculates which messages have expired and emits the goby::acomms::QueueManager::signal_expire as necessary. More... | |
Informational Methods | |
void | info_all (std::ostream *os) const |
Writes a human readable summary (including DCCLCodec info) of all loaded queues. More... | |
template<typename ProtobufMessage > | |
void | info (std::ostream *os) const |
Writes a human readable summary (including DCCLCodec info) of the queue for the provided DCCL type to the stream provided. More... | |
void | info (const google::protobuf::Descriptor *desc, std::ostream *os) const |
An alterative form for getting information for Queues for message types not known at compile-time ("dynamic"). More... | |
const std::string & | glog_push_group () |
const std::string & | glog_pop_group () |
const std::string & | glog_priority_group () |
const std::string & | glog_out_group () |
const std::string & | glog_in_group () |
std::string | msg_string (const google::protobuf::Descriptor *desc) |
int | modem_id () |
The current modem ID (MAC address) of this node. More... | |
protobuf::QueuedMessageMeta | meta_from_msg (const google::protobuf::Message &msg) |
provides an API to the goby-acomms Queuing Library.
Definition at line 66 of file queue_manager.h.
goby::acomms::QueueManager::QueueManager | ( | ) |
constructor
|
default |
destructor
void goby::acomms::QueueManager::add_queue | ( | const google::protobuf::Descriptor * | desc, |
const protobuf::QueuedMessageEntry & | queue_cfg | ||
) |
Alternative method for adding Queues when using Dynamic Protobuf Messages.
|
inline |
Add a DCCL queue for use with QueueManager. Note that the queue must be added before receiving messages with QueueManager.
ProtobufMessage | Any Google Protobuf Message generated by protoc (i.e. subclass of google::protobuf::Message) |
Definition at line 89 of file queue_manager.h.
void goby::acomms::QueueManager::do_work | ( | ) |
Calculates which messages have expired and emits the goby::acomms::QueueManager::signal_expire as necessary.
void goby::acomms::QueueManager::flush_queue | ( | const protobuf::QueueFlush & | flush | ) |
Flush (delete all messages in) a queue.
flush | QueueFlush object containing details about queue to flush |
|
inline |
Definition at line 170 of file queue_manager.h.
|
inline |
Definition at line 169 of file queue_manager.h.
|
inline |
Definition at line 167 of file queue_manager.h.
|
inline |
Definition at line 168 of file queue_manager.h.
|
inline |
Definition at line 166 of file queue_manager.h.
void goby::acomms::QueueManager::handle_modem_data_request | ( | protobuf::ModemTransmission * | msg | ) |
Finds data to send to the modem.
Data from the highest priority queue(s) will be combined to form a message equal or less than the size requested in ModemMessage message_in. If using one of the classes inheriting ModemDriverBase, this method should be connected to ModemDriverBase::signal_data_request.
msg | The ModemTransmission containing information about the data request and is the place where the request data will be stored (in the repeated field ModemTransmission::frame). |
void goby::acomms::QueueManager::handle_modem_receive | ( | const protobuf::ModemTransmission & | message | ) |
Receive incoming data from the modem.
If using one of the classes inheriting ModemDriverBase, this method should be bound and passed to ModemDriverBase::signal_receive.
message | The received ModemMessage. |
void goby::acomms::QueueManager::info | ( | const google::protobuf::Descriptor * | desc, |
std::ostream * | os | ||
) | const |
An alterative form for getting information for Queues for message types not known at compile-time ("dynamic").
|
inline |
Writes a human readable summary (including DCCLCodec info) of the queue for the provided DCCL type to the stream provided.
ProtobufMessage | Any Google Protobuf Message generated by protoc (i.e. subclass of google::protobuf::Message) |
os | Pointer to a stream to write this information |
Definition at line 158 of file queue_manager.h.
void goby::acomms::QueueManager::info_all | ( | std::ostream * | os | ) | const |
Writes a human readable summary (including DCCLCodec info) of all loaded queues.
os | Pointer to a stream to write this information |
void goby::acomms::QueueManager::merge_cfg | ( | const protobuf::QueueManagerConfig & | cfg | ) |
Set (and merge "repeat" fields) the current configuration. (protobuf::QueueManagerConfig defined in acomms_queue.proto)
|
inline |
Definition at line 180 of file queue_manager.h.
|
inline |
The current modem ID (MAC address) of this node.
Definition at line 178 of file queue_manager.h.
|
inline |
Definition at line 172 of file queue_manager.h.
void goby::acomms::QueueManager::push_message | ( | const google::protobuf::Message & | new_message | ) |
Push a message (and add the queue if it does not exist)
new_message | DCCL message to push. |
void goby::acomms::QueueManager::push_message | ( | const google::protobuf::Message & | new_message, |
const protobuf::QueuedMessageMeta * | meta | ||
) |
void goby::acomms::QueueManager::set_cfg | ( | const protobuf::QueueManagerConfig & | cfg | ) |
Set (and overwrite completely if present) the current configuration. (protobuf::QueueManagerConfig defined in acomms_queue.proto)