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

◆ get_operation()

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

Get operation by name.

Template Parameters
ConcreteOpTypeThe expected concrete operation type
Parameters
nameName of the operation to retrieve
Returns
Shared pointer to the operation, or nullptr if not found or wrong type

Retrieves a named operation from the pipeline with automatic type casting. Returns nullptr if no operation with the given name exists or if the operation is not of the expected type.

Example:

auto gain_op = pipeline->get_operation<MathematicalTransformer<>>("gain_stage");
if (gain_op) {
gain_op->set_parameter("gain_factor", 1.5);
}
Concrete transformer for mathematical operations.
void set_parameter(const std::string &name, std::any value) override
Type-safe parameter management with transformation-specific defaults.

Definition at line 230 of file ComputePipeline.hpp.

231 {
232 for (const auto& [operation, op_name] : m_operations) {
233 if (op_name == name) {
234 return std::dynamic_pointer_cast<ConcreteOpType>(operation);
235 }
236 }
237 return nullptr;
238 }
std::vector< std::pair< std::shared_ptr< ComputeOperation< InputType, OutputType > >, std::string > > m_operations
Operations and their names in execution order.