OpenCPN Partial API docs
Loading...
Searching...
No Matches
MeasuredCommOutQueue Class Reference

Add unit test measurements to CommOutQueue. More...

#include <comm_out_queue.h>

Inheritance diagram for MeasuredCommOutQueue:
CommOutQueue

Public Member Functions

 MeasuredCommOutQueue (unsigned max_buffered, std::chrono::duration< unsigned, std::milli > min_msg_gap)
 MeasuredCommOutQueue (unsigned max_buffered)
bool push_back (const std::string &line) override
 Insert valid line of NMEA0183 data in buffer.
std::string pop () override
 Return next line to send and remove it from buffer, throws exception if empty.
Public Member Functions inherited from CommOutQueue
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.
 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

Public Attributes

std::unordered_map< unsigned long, PerfCounter > msg_perf
PerfCounter perf
double push_time
double pop_time

Additional Inherited Members

Protected Types inherited from CommOutQueue
using duration_ms = std::chrono::duration<unsigned, std::milli>
Protected Attributes inherited from CommOutQueue
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

Detailed Description

Add unit test measurements to CommOutQueue.

Definition at line 177 of file comm_out_queue.h.

Constructor & Destructor Documentation

◆ MeasuredCommOutQueue() [1/2]

MeasuredCommOutQueue::MeasuredCommOutQueue ( unsigned max_buffered,
std::chrono::duration< unsigned, std::milli > min_msg_gap )
inline

Definition at line 179 of file comm_out_queue.h.

◆ MeasuredCommOutQueue() [2/2]

MeasuredCommOutQueue::MeasuredCommOutQueue ( unsigned max_buffered)
inline

Definition at line 183 of file comm_out_queue.h.

Member Function Documentation

◆ pop()

std::string MeasuredCommOutQueue::pop ( )
overridevirtual

Return next line to send and remove it from buffer, throws exception if empty.

Reimplemented from CommOutQueue.

Definition at line 189 of file comm_out_queue.cpp.

◆ push_back()

bool MeasuredCommOutQueue::push_back ( const std::string & line)
overridevirtual

Insert valid line of NMEA0183 data in buffer.

Returns
false on errors including invalid input, else true.

Reimplemented from CommOutQueue.

Definition at line 174 of file comm_out_queue.cpp.

Member Data Documentation

◆ msg_perf

std::unordered_map<unsigned long, PerfCounter> MeasuredCommOutQueue::msg_perf

Definition at line 190 of file comm_out_queue.h.

◆ perf

PerfCounter MeasuredCommOutQueue::perf

Definition at line 192 of file comm_out_queue.h.

◆ pop_time

double MeasuredCommOutQueue::pop_time

Definition at line 194 of file comm_out_queue.h.

◆ push_time

double MeasuredCommOutQueue::push_time

Definition at line 193 of file comm_out_queue.h.


The documentation for this class was generated from the following files: