MayaFlux 0.3.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 441 of file Logic.cpp.

442{
443 m_sequential_function = std::move(function);
446
447 if (history_size != m_history_size) {
448 m_history_size = history_size;
449 m_history_ring.resize(history_size, false);
450 m_history_linear.resize(history_size, false);
451 m_history_head = 0;
452 m_history_count = 0;
453 }
454}
SequentialFunction m_sequential_function
Function for sequential mode.
Definition Logic.hpp:584
std::vector< uint8_t > m_history_linear
Linear view of history for easy access.
Definition Logic.hpp:601
size_t m_history_size
Maximum size of the history buffer.
Definition Logic.hpp:588
LogicOperator m_operator
Current logic operator.
Definition Logic.hpp:581
std::vector< uint8_t > m_history_ring
Ring buffer for history storage.
Definition Logic.hpp:600
size_t m_history_count
Number of valid entries in the history buffer.
Definition Logic.hpp:587
size_t m_history_head
Head index for the history ring buffer.
Definition Logic.hpp:586
LogicMode m_mode
Current processing mode.
Definition Logic.hpp:580
@ 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.