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

◆ process_tagged()

void MayaFlux::Kakshya::DataProcessingChain::process_tagged ( const std::shared_ptr< SignalSourceContainer > &  container,
const std::string &  tag 
)

Processes a container with only the processors carrying a specific tag.

Parameters
containerThe signal container to process.
tagTag string to match against registered processor tags.

Definition at line 118 of file DataProcessingChain.cpp.

121{
122 bool expected = false;
123 if (!m_is_processing.compare_exchange_strong(expected, true,
124 std::memory_order_acquire, std::memory_order_relaxed)) {
125 return;
126 }
127
128 auto it = m_container_processors.find(container);
129 if (it != m_container_processors.end()) {
130 for (auto& processor : it->second) {
131 auto tag_it = m_processor_tags.find(processor);
132 if (tag_it != m_processor_tags.end() && tag_it->second == tag) {
133 processor->process(container);
134 }
135 }
136 }
137
138 m_is_processing.store(false, std::memory_order_release);
140}
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.
std::unordered_map< std::shared_ptr< DataProcessor >, std::string > m_processor_tags
Maps processors to their optional tag strings.

References drain_pending_removals(), m_container_processors, m_is_processing, and m_processor_tags.

+ Here is the call graph for this function: