OpenCPN Partial API docs
|
Queue of NMEA0183 messages which only holds a limited amount of each message type. More...
#include <comm_out_queue.h>
Classes | |
struct | BufferItem |
Public Member Functions | |
virtual bool | push_back (const std::string &line) |
Insert valid line of NMEA0183 data in buffer. More... | |
virtual std::string | pop () |
Return next line to send and remove it from buffer, throws exception if empty. | |
virtual int | size () const |
Return number of lines in queue. | |
CommOutQueue (unsigned max_buffered, std::chrono::duration< unsigned, std::milli > min_msg_gap) | |
Create a buffer which stores at most max_buffered items of each message, applying rate limits if messages are entered "too" fast. More... | |
CommOutQueue (unsigned max_buffered) | |
Create a buffer which stores at most max_buffered items of each message. | |
CommOutQueue () | |
Default buffer, allows 10 buffered messages of each type, applies rate limits when repeated with less than 600 ms intervals. | |
CommOutQueue (const CommOutQueue &other)=delete | |
CommOutQueue & | operator= (const CommOutQueue &)=delete |
Protected Types | |
using | duration_ms = std::chrono::duration< unsigned, std::milli > |
Protected Attributes | |
std::vector< BufferItem > | m_buffer |
std::mutex | m_mutex |
int | m_size |
duration_ms | m_min_msg_gap |
bool | m_overrun_reported |
std::set< uint64_t > | m_rate_limits_logged |
Queue of NMEA0183 messages which only holds a limited amount of each message type.
Definition at line 78 of file comm_out_queue.h.
CommOutQueue::CommOutQueue | ( | unsigned | max_buffered, |
std::chrono::duration< unsigned, std::milli > | min_msg_gap | ||
) |
Create a buffer which stores at most max_buffered items of each message, applying rate limits if messages are entered "too" fast.
max_buffered | Max number of messages of a type kept in buffer without discarding data as overrun. |
min_msg_gap | minimum time between two messages of the same type without applying rate limits. |
Definition at line 75 of file comm_out_queue.cpp.
|
virtual |
Insert valid line of NMEA0183 data in buffer.
Reimplemented in DummyCommOutQueue, MeasuredCommOutQueue, and CommOutQueueSingle.
Definition at line 82 of file comm_out_queue.cpp.