Optimizes the processing pipeline for improved performance.
Analyzes the current processor sequence and applies various optimization strategies:
236{
238 if (processors.empty()) {
239 return;
240 }
241
242 std::vector<std::shared_ptr<BufferProcessor>> compatible_processors;
243 std::vector<std::shared_ptr<BufferProcessor>> incompatible_processors;
244
245 for (auto& processor : processors) {
246 auto processor_token = processor->get_processing_token();
248 compatible_processors.push_back(processor);
249 } else {
250 incompatible_processors.push_back(processor);
251 }
252 }
253
254 processors.clear();
255
256 processors.insert(processors.end(), compatible_processors.begin(), compatible_processors.end());
257
259 processors.insert(processors.end(), incompatible_processors.begin(), incompatible_processors.end());
260 }
261}
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.