MayaFlux 0.1.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 404 of file ComputeGrammar.hpp.

405 {
406 m_rule.executor = [func = std::forward<Func>(executor)](const std::any& input, const ExecutionContext& ctx) -> std::any {
407 return func(input, ctx);
408 };
409 return *this;
410 }
std::function< std::any(const std::any &, const ExecutionContext &)> executor
Function that performs the computation.

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