Optimizes the processing pipeline for improved performance.
Analyzes the current processor sequence and applies various optimization strategies:
293{
295 if (processors.empty()) {
296 return;
297 }
298
299 std::vector<std::shared_ptr<BufferProcessor>> compatible_processors;
300 std::vector<std::shared_ptr<BufferProcessor>> incompatible_processors;
301
302 for (auto& processor : processors) {
303 auto processor_token = processor->get_processing_token();
305 compatible_processors.push_back(processor);
306 } else {
307 incompatible_processors.push_back(processor);
308 }
309 }
310
311 processors.clear();
312
313 processors.insert(processors.end(), compatible_processors.begin(), compatible_processors.end());
314
316 processors.insert(processors.end(), incompatible_processors.begin(), incompatible_processors.end());
317 }
318}
ProcessingToken m_token_filter_mask
Preferred processing token for this chain.
std::unordered_map< std::shared_ptr< Buffer >, std::vector< std::shared_ptr< BufferProcessor > > > m_buffer_processors
Map of buffers to their processor sequences.
TokenEnforcementStrategy m_enforcement_strategy
Token enforcement strategy for this chain.
bool are_tokens_compatible(ProcessingToken preferred, ProcessingToken current)
Determines if two processing tokens are compatible for joint execution.
@ STRICT
Strictly enforces token assignment with no cross-token sharing.
@ FILTERED
Filters processors through token enumeration, allowing compatible combinations.