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

◆ executes()

template<typename Func >
RuleBuilder & MayaFlux::Yantra::ComputationGrammar::RuleBuilder::executes ( Func &&  executor)
inline

Sets the executor function for this rule.

Template Parameters
FuncFunction type (usually a lambda)
Parameters
executorFunction that performs the computation
Returns
Reference to this builder for method chaining

The executor function receives the input data and execution context, and returns the result of the computation. This is where the actual work of the rule is performed.

Definition at line 408 of file ComputeGrammar.hpp.

409 {
410 m_rule.executor = [func = std::forward<Func>(executor)](const std::any& input, const ExecutionContext& ctx) -> std::any {
411 return func(input, ctx);
412 };
413 return *this;
414 }
Executor executor
Function that performs the computation.

References MayaFlux::Yantra::ComputationGrammar::Rule::executor.