MayaFlux 0.4.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 214 of file ComputeGrammar.hpp.

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