SatCat5
satcat5::io::CounterSimple Class Reference

Detailed Description

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,

See also
CounterInline.

Definition at line 47 of file io_counter.h.

#include <io_counter.h>

Inheritance diagram for satcat5::io::CounterSimple:
[legend]
Collaboration diagram for satcat5::io::CounterSimple:
[legend]

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.
 

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