|
MayaFlux 0.1.0
Digital-First Multimedia Processing Framework
|
Fluent interface for building rules with method chaining. More...
#include <ComputeGrammar.hpp>
Collaboration diagram for MayaFlux::Yantra::ComputationGrammar::RuleBuilder:Public Member Functions | |
| RuleBuilder (ComputationGrammar *grammar, std::string name) | |
| Constructs a RuleBuilder for the specified grammar. | |
| RuleBuilder & | with_context (ComputationContext context) |
| Sets the computation context for this rule. | |
| RuleBuilder & | with_priority (int priority) |
| Sets the execution priority for this rule. | |
| RuleBuilder & | with_description (std::string description) |
| Sets a human-readable description for this rule. | |
| template<ComputeData DataType> | |
| RuleBuilder & | matches_type () |
| Sets the matcher to check for a specific data type. | |
| RuleBuilder & | matches_custom (UniversalMatcher::MatcherFunc matcher) |
| Sets a custom matcher function. | |
| template<typename Func > | |
| RuleBuilder & | executes (Func &&executor) |
| Sets the executor function for this rule. | |
| template<typename OperationType > | |
| RuleBuilder & | targets_operation () |
| Sets the target operation type for this rule. | |
| RuleBuilder & | with_tags (std::vector< std::string > tags) |
| Sets arbitrary tags for this rule. | |
| void | build () |
| Finalizes and adds the rule to the grammar. | |
Private Attributes | |
| Rule | m_rule |
| Rule being constructed. | |
| ComputationGrammar * | m_grammar |
| Reference to parent grammar. | |
Fluent interface for building rules with method chaining.
The RuleBuilder provides a clean, readable way to construct complex rules using method chaining. This pattern makes rule creation more expressive and helps catch configuration errors at compile time.
Example usage:
Definition at line 312 of file ComputeGrammar.hpp.