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

◆ process_typed()

template<typename ProcessorType >
void MayaFlux::Kakshya::DataProcessingChain::process_typed ( const std::shared_ptr< SignalSourceContainer > &  container)
inline

Processes a container with only processors of a specific derived type.

Template Parameters
ProcessorTypeConcrete DataProcessor subtype to dispatch to.
Parameters
containerThe signal container to process.

Definition at line 84 of file DataProcessingChain.hpp.

85 {
86 bool expected = false;
87 if (!m_is_processing.compare_exchange_strong(expected, true,
88 std::memory_order_acquire, std::memory_order_relaxed)) {
89 return;
90 }
91
92 auto it = m_container_processors.find(container);
93 if (it != m_container_processors.end()) {
94 for (auto& processor : it->second) {
95 if (auto typed = std::dynamic_pointer_cast<ProcessorType>(processor)) {
96 typed->process(container);
97 }
98 }
99 }
100
101 m_is_processing.store(false, std::memory_order_release);
103 }
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.