|
SatCat5
|
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>
Public Member Functions | |
| constexpr | MeasurementCache () |
| Create an empty cache. | |
| satcat5::ptp::Measurement * | find (const satcat5::ptp::Header &hdr, const satcat5::ptp::PortId &port) |
| Find the first matching measurement in the cache. More... | |
| satcat5::ptp::Measurement * | find (const satcat5::ptp::Header &hdr) |
| Shortcut for searches where port = hdr.src_port. | |
| satcat5::ptp::Measurement * | push (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] |
| 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.
| Measurement * MeasurementCache::push | ( | const satcat5::ptp::Header & | hdr | ) |
Create a new measurement, overwriting the oldest.
Definition at line 72 of file ptp_measurement.cc.