MayaFlux 0.2.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 334 of file BufferProcessingChain.hpp.

335 {
336 auto processors = get_processors(buffer);
337
338 for (auto& processor : processors) {
339 if (auto t_processor = std::dynamic_pointer_cast<T>(processor)) {
340 return t_processor;
341 }
342 }
343 return nullptr;
344 }
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.