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

◆ process_filtered()

void MayaFlux::Kakshya::DataProcessingChain::process_filtered ( const std::shared_ptr< SignalSourceContainer > &  container,
const std::function< bool(const std::shared_ptr< DataProcessor > &)> &  filter 
)

Processes a container with only the processors matching a filter predicate.

Parameters
containerThe signal container to process.
filterPredicate returning true for processors that should run.

Definition at line 95 of file DataProcessingChain.cpp.

98{
99 bool expected = false;
100 if (!m_is_processing.compare_exchange_strong(expected, true,
101 std::memory_order_acquire, std::memory_order_relaxed)) {
102 return;
103 }
104
105 auto it = m_container_processors.find(container);
106 if (it != m_container_processors.end()) {
107 for (auto& processor : it->second) {
108 if (filter(processor)) {
109 processor->process(container);
110 }
111 }
112 }
113
114 m_is_processing.store(false, std::memory_order_release);
116}
void drain_pending_removals()
Flushes all removals deferred during the most recent process iteration.
std::unordered_map< std::shared_ptr< SignalSourceContainer >, std::vector< std::shared_ptr< DataProcessor > > > m_container_processors
Maps each container to its ordered processor sequence.
std::atomic< bool > m_is_processing
Guards all process variants against concurrent or re-entrant iteration.

References drain_pending_removals(), m_container_processors, and m_is_processing.

+ Here is the call graph for this function: