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

◆ add_operation()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
template<typename ConcreteOpType >
ComputationPipeline & MayaFlux::Yantra::ComputationPipeline< InputType, OutputType >::add_operation ( std::shared_ptr< ConcreteOpType >  operation,
const std::string &  name = "" 
)
inline

Add a concrete operation instance to the pipeline.

Template Parameters
ConcreteOpTypeThe concrete operation type (must derive from ComputeOperation)
Parameters
operationShared pointer to the operation instance
nameOptional name for the operation (used for later reference)
Returns
Reference to this pipeline for method chaining

Adds an existing operation instance to the pipeline. The operation will be executed in the order it was added. Names are optional but recommended for later configuration and debugging.

Note
The operation type must be compatible with the pipeline's input/output types

Definition at line 98 of file ComputePipeline.hpp.

99 {
100 static_assert(std::is_base_of_v<ComputeOperation<InputType, OutputType>, ConcreteOpType>,
101 "Operation must derive from ComputeOperation");
102
103 m_operations.emplace_back(std::static_pointer_cast<ComputeOperation<InputType, OutputType>>(operation), name);
104 return *this;
105 }
std::vector< std::pair< std::shared_ptr< ComputeOperation< InputType, OutputType > >, std::string > > m_operations
Operations and their names in execution order.