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

◆ push()

template<typename T >
void MayaFlux::Memory::HistoryBuffer< T >::push ( const T &  value)
inline

Push new value to front of history.

Parameters
valueNew sample value

Inserts value at index 0, shifting all previous values back. Oldest value (at index capacity-1) is discarded.

Definition at line 373 of file RingBuffer.hpp.

374 {
375 if (m_capacity == 0)
376 return;
377
378 m_head = (m_head == 0) ? m_capacity - 1 : m_head - 1;
379 m_data[m_head] = value;
380
381 if (m_count < m_capacity) {
382 ++m_count;
383 }
384 }

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.

Referenced by MayaFlux::Nodes::Network::WaveguideNetwork::process_bidirectional(), MayaFlux::Nodes::Generator::Polynomial::process_sample(), MayaFlux::Nodes::Network::WaveguideNetwork::process_unidirectional(), and MayaFlux::Buffers::FeedbackProcessor::processing_function().

+ Here is the caller graph for this function: