MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ oldest() [1/2]

template<typename T >
reference MayaFlux::Memory::HistoryBuffer< T >::oldest ( )
inline

Get oldest element (same as [capacity-1])

Returns
Reference to oldest sample in buffer

Definition at line 422 of file RingBuffer.hpp.

423 {
424 size_t oldest_idx = (m_head + m_count - 1) % m_capacity;
425 return m_data[oldest_idx];
426 }

References MayaFlux::Memory::HistoryBuffer< T >::m_capacity, MayaFlux::Memory::HistoryBuffer< T >::m_count, MayaFlux::Memory::HistoryBuffer< T >::m_data, and MayaFlux::Memory::HistoryBuffer< T >::m_head.