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

◆ create_configured_operation()

template<typename OperationType , typename... Args>
std::shared_ptr< OperationType > MayaFlux::Yantra::create_configured_operation ( const std::unordered_map< std::string, std::any > &  parameters,
Args &&...  args 
)

Creates an operation instance with parameters using safe_any_cast system.

Template Parameters
OperationTypeType of operation to create
ArgsConstructor argument types
Parameters
parametersMap of parameter names to values
argsConstructor arguments
Returns
Configured operation instance

Definition at line 119 of file GrammarHelper.hpp.

122{
123 auto operation = std::make_shared<OperationType>(std::forward<Args>(args)...);
124
125 for (const auto& [param_name, param_value] : parameters) {
126 try {
127 operation->set_parameter(param_name, param_value);
128 } catch (...) {
129 // Ignore parameters that don't apply to this operation
130 }
131 }
132
133 return operation;
134}