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

◆ remove_processor_anywhere_direct()

void MayaFlux::Buffers::BufferProcessingChain::remove_processor_anywhere_direct ( const std::shared_ptr< BufferProcessor > &  processor,
const std::shared_ptr< Buffer > &  buffer 
)
protected

Definition at line 115 of file BufferProcessingChain.cpp.

116{
117 auto regular_it = m_buffer_processors.find(buffer);
118 if (regular_it != m_buffer_processors.end()) {
119 auto processor_it = std::ranges::find(regular_it->second, processor);
120 if (processor_it != regular_it->second.end()) {
121 processor->on_detach(buffer);
122 regular_it->second.erase(processor_it);
123 m_conditional_processors[buffer].erase(processor);
124 m_pending_removal[buffer].erase(processor);
125 return;
126 }
127 }
128
129 auto remove_slot = [&processor, &buffer](auto& slots, const auto& key) {
130 auto it = slots.find(key);
131 if (it == slots.end() || it->second != processor)
132 return false;
133
134 it->second->on_detach(buffer);
135 slots.erase(it);
136 return true;
137 };
138
139 if (remove_slot(m_preprocessors, buffer)
140 || remove_slot(m_postprocessors, buffer)
141 || remove_slot(m_final_processors, buffer)) {
142 return;
143 }
144}
std::shared_ptr< NetworkGeometryBuffer > buffer
std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< BufferProcessor > > m_final_processors
Map of buffers to their final processors.
std::unordered_map< std::shared_ptr< Buffer >, std::unordered_set< std::shared_ptr< BufferProcessor > > > m_pending_removal
Map of buffers to processors pending removal.
std::unordered_map< std::shared_ptr< Buffer >, std::vector< std::shared_ptr< BufferProcessor > > > m_buffer_processors
Map of buffers to their processor sequences.
std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< BufferProcessor > > m_preprocessors
Map of buffers to their preprocessors.
std::unordered_map< std::shared_ptr< Buffer >, std::unordered_set< std::shared_ptr< BufferProcessor > > > m_conditional_processors
Map of buffers to processors that are conditionally applied.
std::unordered_map< std::shared_ptr< Buffer >, std::shared_ptr< BufferProcessor > > m_postprocessors
Map of buffers to their postprocessors.

References buffer, m_buffer_processors, m_conditional_processors, m_final_processors, m_pending_removal, m_postprocessors, and m_preprocessors.

Referenced by process_pending_processor_operations(), and remove_processor_internal().

+ Here is the caller graph for this function: