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

◆ get_rules_for_operation_type()

template<typename OperationType >
std::vector< std::string > MayaFlux::Yantra::ComputationGrammar::get_rules_for_operation_type ( ) const
inline

Get rules that target a specific operation type.

Template Parameters
OperationTypeThe operation type to search for
Returns
Vector of rule names that create or target the specified operation type

Enables type-based rule discovery, useful for finding all rules that can create instances of a particular operation type or for verifying rule coverage for specific operation types.

Example:

auto math_rules = grammar.get_rules_for_operation_type<MathematicalTransformer<>>();
// Returns names of all rules that create MathematicalTransformer instances
Concrete transformer for mathematical operations.

Definition at line 209 of file ComputeGrammar.hpp.

210 {
211 std::vector<std::string> matching_rules;
212 auto target_type = std::type_index(typeid(OperationType));
213
214 for (const auto& rule : m_rules) {
215 if (rule.target_operation_type == target_type) {
216 matching_rules.push_back(rule.name);
217 }
218 }
219 return matching_rules;
220 }
std::vector< Rule > m_rules
All rules sorted by priority (highest first)
OperationType
Operation categories for organization and discovery.