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

◆ get_processor()

template<typename T >
std::shared_ptr< T > MayaFlux::Buffers::BufferProcessingChain::get_processor ( const std::shared_ptr< Buffer > &  buffer) const
inline

Gets a processor of a specific type from the buffer's processing pipeline.

Template Parameters
TType of the processor to retrieve
Parameters
bufferBuffer to get the processor from
Returns
Shared pointer to the processor if found, nullptr otherwise

This method searches for a processor of the specified type in the buffer's transformation sequence. If found, it returns a shared pointer to the processor, allowing type-safe access to specialized functionality.

Definition at line 355 of file BufferProcessingChain.hpp.

356 {
357 auto processors = get_processors(buffer);
358
359 for (auto& processor : processors) {
360 if (auto t_processor = std::dynamic_pointer_cast<T>(processor)) {
361 return t_processor;
362 }
363 }
364 return nullptr;
365 }
const std::vector< std::shared_ptr< BufferProcessor > > & get_processors(const std::shared_ptr< Buffer > &buffer) const
Gets all processors in a buffer's transformation pipeline.