|
SatCat5
|
Simple implementation of the Counter API.
This class can be used as a standalone unit, by calling the public API for byte_incr, frame_incr, and error_incr.
Alternately, a child class may directly increment member variables m_byte_ct, m_frm_ct, and m_err_ct. For an example based on WriteableRedirect,
Definition at line 47 of file io_counter.h.
#include <io_counter.h>
Public Member Functions | |
| unsigned | byte_count (bool reset=true) override |
| Bytes transferred since the last query. | |
| unsigned | frame_count (bool reset=true) override |
| Frames transferred since the last query. | |
| unsigned | error_count (bool reset=true) override |
| (Optional) Error events since the last query. | |
| void | byte_incr (unsigned incr) |
| Increment any of the internal counters. | |
| void | frame_incr (unsigned incr) |
| void | error_incr (unsigned incr) |
Protected Member Functions | |
| constexpr | CounterSimple () |
| Constructor is only accessible to the child object. | |
Protected Attributes | |
| unsigned | m_byte_ct |
| Cumulative byte count. | |
| unsigned | m_err_ct |
| Cumulative error count. | |
| unsigned | m_frm_ct |
| Cumulative frame count. | |
| unsigned | m_frm_len |
| Length of current frame. | |