MayaFlux 1.0.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 364 of file BufferProcessingChain.hpp.

365 {
366 auto processors = get_processors(buffer);
367
368 for (auto& processor : processors) {
369 if (auto t_processor = std::dynamic_pointer_cast<T>(processor)) {
370 return t_processor;
371 }
372 }
373 return nullptr;
374 }
std::shared_ptr< NetworkGeometryBuffer > buffer
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.

References buffer.