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

◆ push_singlethread()

template<typename T , typename StoragePolicy , typename ConcurrencyPolicy = SingleThreadedPolicy, typename AccessPattern = QueueAccess>
bool MayaFlux::Memory::RingBuffer< T, StoragePolicy, ConcurrencyPolicy, AccessPattern >::push_singlethread ( const T &  value)
inlineprivatenoexcept

Definition at line 1168 of file RingBuffer.hpp.

1169 {
1170 const size_t cap = m_storage.capacity();
1171 auto next_write = State::increment(m_state.write_index, cap);
1172
1173 if (next_write == m_state.read_index) {
1174 return false;
1175 }
1176
1177 if constexpr (AccessPattern::push_front) {
1178 m_state.write_index = (m_state.write_index == 0)
1179 ? cap - 1
1180 : m_state.write_index - 1;
1181 m_storage.buffer[m_state.write_index] = value;
1182 } else {
1183 m_storage.buffer[m_state.write_index] = value;
1184 m_state.write_index = next_write;
1185 }
1186
1187 return true;
1188 }
float value

References MayaFlux::Memory::RingBuffer< T, StoragePolicy, ConcurrencyPolicy, AccessPattern >::m_state, MayaFlux::Memory::RingBuffer< T, StoragePolicy, ConcurrencyPolicy, AccessPattern >::m_storage, and value.

Referenced by MayaFlux::Memory::RingBuffer< T, StoragePolicy, ConcurrencyPolicy, AccessPattern >::push().

+ Here is the caller graph for this function: