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

◆ set_initial_conditions()

void MayaFlux::Nodes::Generator::Logic::set_initial_conditions ( const std::vector< bool > &  initial_values)

Preloads the state history buffer.

Parameters
initial_valuesVector of initial boolean states

Initializes the history buffer with specified values, allowing sequential logic to begin operation with a predefined state sequence. Useful for testing specific patterns or starting from known states.

Definition at line 667 of file Logic.cpp.

668{
669 m_history_head = 0;
670 m_history_count = std::min(initial_values.size(), m_history_size);
671
672 for (size_t i = 0; i < m_history_count; ++i) {
673 m_history_ring[i] = initial_values[i];
674 }
675}
size_t m_history_size
Maximum size of the history buffer.
Definition Logic.hpp:702
std::vector< uint8_t > m_history_ring
Ring buffer for history storage.
Definition Logic.hpp:716
size_t m_history_count
Number of valid entries in the history buffer.
Definition Logic.hpp:701
size_t m_history_head
Head index for the history ring buffer.
Definition Logic.hpp:700

References m_history_count, m_history_head, m_history_ring, and m_history_size.