SatCat5
satcat5::ptp::MeasurementCache Class Reference

Detailed Description

Searchable cache of recent Measurement objects.

The MeasurementCache class defines a searchable cache of recent in-progress Measurement objects. Each ptp::Client uses the cache to match incoming messages against previous received messages.

Definition at line 85 of file ptp_measurement.h.

#include <ptp_measurement.h>

Collaboration diagram for satcat5::ptp::MeasurementCache:
[legend]

Public Member Functions

constexpr MeasurementCache ()
 Create an empty cache.
 
satcat5::ptp::Measurementfind (const satcat5::ptp::Header &hdr, const satcat5::ptp::PortId &port)
 Find the first matching measurement in the cache. More...
 
satcat5::ptp::Measurementfind (const satcat5::ptp::Header &hdr)
 Shortcut for searches where port = hdr.src_port.
 
satcat5::ptp::Measurementpush (const satcat5::ptp::Header &hdr)
 Create a new measurement, overwriting the oldest. More...
 

Protected Attributes

unsigned m_next_wr
 
satcat5::ptp::Measurement m_buff [SATCAT5_PTP_CACHE_SIZE]
 

Member Function Documentation

◆ find()

Measurement * MeasurementCache::find ( const satcat5::ptp::Header hdr,
const satcat5::ptp::PortId port 
)

Find the first matching measurement in the cache.

(If no match is found, return NULL.)

Definition at line 64 of file ptp_measurement.cc.

◆ push()

Measurement * MeasurementCache::push ( const satcat5::ptp::Header hdr)

Create a new measurement, overwriting the oldest.

Returns
A pointer to the newly-created Measurement object.

Definition at line 72 of file ptp_measurement.cc.


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