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

◆ configure_operation()

template<ComputeData InputType = std::vector<Kakshya::DataVariant>, ComputeData OutputType = InputType>
template<typename ConcreteOpType >
bool MayaFlux::Yantra::ComputationPipeline< InputType, OutputType >::configure_operation ( const std::string &  name,
const std::function< void(std::shared_ptr< ConcreteOpType >)> &  configurator 
)
inline

Configure operation by name.

Template Parameters
ConcreteOpTypeThe expected concrete operation type
Parameters
nameName of the operation to configure
configuratorFunction that configures the operation
Returns
True if operation was found and configured, false otherwise

Provides a safe way to configure named operations in the pipeline. The configurator function is only called if an operation with the given name exists and is of the expected type.

Example:

bool configured = pipeline->configure_operation<SpectralTransformer<>>("pitch_shift",
[](auto op) {
op->set_parameter("pitch_ratio", 1.5);
op->set_parameter("window_size", 2048);
});
Concrete transformer for frequency-domain operations.

Definition at line 261 of file ComputePipeline.hpp.

263 {
264 for (auto& [operation, op_name] : m_operations) {
265 if (op_name == name) {
266 if (auto concrete_op = std::dynamic_pointer_cast<ConcreteOpType>(operation)) {
267 configurator(concrete_op);
268 return true;
269 }
270 }
271 }
272 return false;
273 }
std::vector< std::pair< std::shared_ptr< ComputeOperation< InputType, OutputType > >, std::string > > m_operations
Operations and their names in execution order.