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

◆ RewriteOperator()

MayaFlux::Nodes::Network::RewriteOperator::RewriteOperator ( Config config)
explicit

Definition at line 27 of file RewriteOperator.cpp.

28 : m_max_word_length(config.max_word_length)
29 , m_max_generations(config.max_generations)
30 , m_valid(true)
31 , m_ignore(std::move(config.ignore))
32{
33 if (config.axiom.size() > m_max_word_length) {
35 "RewriteOperator axiom has {} symbols, exceeding max_word_length {}",
36 config.axiom.size(), m_max_word_length);
37 m_valid = false;
38 }
39
40 if (std::ranges::any_of(config.axiom, [](const Symbol& symbol) {
41 return symbol.arity > max_symbol_parameters;
42 })) {
44 "RewriteOperator axiom contains a symbol with more than {} parameters",
46 m_valid = false;
47 }
48
49 m_axiom = std::make_shared<const Word>(Word {
50 .symbols = m_valid ? std::move(config.axiom) : std::vector<Symbol> {},
51 .generation = 0 });
52 m_draft = m_axiom;
53 m_active_word = m_axiom;
54 m_submitted = Submission { .word = m_axiom, .id = 0 };
55 m_active = Submission { .word = m_axiom, .id = 0 };
56}
#define MF_ERROR(comp, ctx,...)
@ Configuration
Configuration and parameter updates.
@ Nodes
DSP Generator and Filter Nodes, graph pipeline, node management.

References MayaFlux::Nodes::Network::RewriteOperator::Config::axiom, MayaFlux::Nodes::Network::RewriteOperator::Word::generation, m_axiom, m_ignore, m_max_generations, m_max_word_length, and m_valid.