MayaFlux 0.5.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 504 of file RingBuffer.hpp.

505 {
506 size_t oldest_idx = (m_head + m_count - 1) % m_capacity;
507 return m_data[oldest_idx];
508 }

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.