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

◆ remove_child_buffer()

template<typename BufferType >
virtual void MayaFlux::Buffers::RootBuffer< BufferType >::remove_child_buffer ( const std::shared_ptr< BufferType > &  buffer)
inlinevirtual

Removes a tributary buffer from this root buffer.

Parameters
bufferChild buffer to remove from the aggregation hierarchy

Definition at line 65 of file RootBuffer.hpp.

66 {
67 if (this->is_processing()) {
68 for (auto& m_pending_op : m_pending_ops) {
69 bool expected = false;
70 if (m_pending_op.active.compare_exchange_strong(expected, true, std::memory_order_acquire, std::memory_order_relaxed)) {
71 m_pending_op.buffer = buffer;
72 m_pending_op.is_addition = false;
73 m_pending_count.fetch_add(1, std::memory_order_relaxed);
74 return;
75 }
76 }
77
78 return;
79 }
80
82 }
void remove_child_buffer_direct(const std::shared_ptr< BufferType > &buffer)
struct MayaFlux::Buffers::RootBuffer::PendingBufferOp m_pending_ops[MAX_PENDING]
std::atomic< uint32_t > m_pending_count