MayaFlux 0.1.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 276 of file BufferProcessingChain.hpp.

277 {
278 auto processors = get_processors(buffer);
279
280 for (auto& processor : processors) {
281 if (auto t_processor = std::dynamic_pointer_cast<T>(processor)) {
282 return t_processor;
283 }
284 }
285 return nullptr;
286 }
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.