MayaFlux 0.4.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 239 of file ComputePipeline.hpp.

240 {
241 for (const auto& [operation, op_name] : m_operations) {
242 if (op_name == name) {
243 return std::dynamic_pointer_cast<ConcreteOpType>(operation);
244 }
245 }
246 return nullptr;
247 }
std::vector< std::pair< std::shared_ptr< ComputeOperation< InputType, OutputType > >, std::string > > m_operations
Operations and their names in execution order.