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

◆ set_sequential_function()

void MayaFlux::Nodes::Generator::Logic::set_sequential_function ( SequentialFunction  function,
size_t  history_size 
)

Sets a custom state-based evaluation function.

Parameters
functionFunction implementing sequential boolean logic
history_sizeSize of the state history buffer

Configures the node to maintain a history of previous states and evaluate new inputs in this context using a user-defined function. Enables implementation of sequential logic, pattern detectors, and finite state machines.

Definition at line 445 of file Logic.cpp.

446{
447 m_sequential_function = std::move(function);
450
451 if (history_size != m_history_size) {
452 m_history_size = history_size;
453 m_history_ring.resize(history_size, false);
454 m_history_linear.resize(history_size, false);
455 m_history_head = 0;
456 m_history_count = 0;
457 }
458}
SequentialFunction m_sequential_function
Function for sequential mode.
Definition Logic.hpp:570
std::vector< uint8_t > m_history_linear
Linear view of history for easy access.
Definition Logic.hpp:587
size_t m_history_size
Maximum size of the history buffer.
Definition Logic.hpp:574
LogicOperator m_operator
Current logic operator.
Definition Logic.hpp:567
std::vector< uint8_t > m_history_ring
Ring buffer for history storage.
Definition Logic.hpp:586
size_t m_history_count
Number of valid entries in the history buffer.
Definition Logic.hpp:573
size_t m_history_head
Head index for the history ring buffer.
Definition Logic.hpp:572
LogicMode m_mode
Current processing mode.
Definition Logic.hpp:566
@ SEQUENTIAL
State-based evaluation using history of inputs (sequential logic)
@ CUSTOM
User-defined boolean function.

References MayaFlux::Nodes::Generator::CUSTOM, m_history_count, m_history_head, m_history_linear, m_history_ring, m_history_size, m_mode, m_operator, m_sequential_function, and MayaFlux::Nodes::Generator::SEQUENTIAL.