Optimizes the processing pipeline for improved performance.
Analyzes the current processor sequence and applies various optimization strategies:
272{
274 if (processors.empty()) {
275 return;
276 }
277
278 std::vector<std::shared_ptr<BufferProcessor>> compatible_processors;
279 std::vector<std::shared_ptr<BufferProcessor>> incompatible_processors;
280
281 for (auto& processor : processors) {
282 auto processor_token = processor->get_processing_token();
284 compatible_processors.push_back(processor);
285 } else {
286 incompatible_processors.push_back(processor);
287 }
288 }
289
290 processors.clear();
291
292 processors.insert(processors.end(), compatible_processors.begin(), compatible_processors.end());
293
295 processors.insert(processors.end(), incompatible_processors.begin(), incompatible_processors.end());
296 }
297}
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.