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

◆ update()

template<typename T >
void MayaFlux::Memory::HistoryBuffer< T >::update ( size_t  index,
const T &  value 
)
inline

Update element at specific index.

Parameters
indexTemporal offset (0 = newest, k = k samples ago)
valueNew value

Definition at line 478 of file RingBuffer.hpp.

479 {
480 if (index >= m_count) {
481 return;
482 }
483 m_data[(m_head + index) % m_capacity] = value;
484 }

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.