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
-
| ConcreteOpType | The expected concrete operation type |
- Parameters
-
| name | Name of the operation to configure |
| configurator | Function 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:
[](auto op) {
op->set_parameter("pitch_ratio", 1.5);
op->set_parameter("window_size", 2048);
});
Definition at line 261 of file ComputePipeline.hpp.
263 {
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.