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

◆ create_operation()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
template<typename ConcreteOpType , typename... Args>
ComputationPipeline & MayaFlux::Yantra::ComputationPipeline< InputType, OutputType >::create_operation ( const std::string &  name = "",
Args &&...  args 
)
inline

Create and add operation by type.

Template Parameters
ConcreteOpTypeThe concrete operation type to create
ArgsConstructor argument types
Parameters
nameOptional name for the operation
argsConstructor arguments for the operation
Returns
Reference to this pipeline for method chaining

Creates a new instance of the specified operation type and adds it to the pipeline. This is the most convenient way to add operations when you don't need to configure them before adding to the pipeline.

Example:

pipeline->create_operation<MathematicalTransformer<>>("gain")
ComputationPipeline & create_operation(const std::string &name="", Args &&... args)
Create and add operation by type.
Concrete transformer for mathematical operations.
Concrete transformer for frequency-domain operations.
@ PITCH_SHIFT
Pitch-preserving shift.

Definition at line 127 of file ComputePipeline.hpp.

128 {
129 auto operation = std::make_shared<ConcreteOpType>(std::forward<Args>(args)...);
130 return add_operation(operation, name);
131 }
ComputationPipeline & add_operation(std::shared_ptr< ConcreteOpType > operation, const std::string &name="")
Add a concrete operation instance to the pipeline.