MayaFlux 0.2.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 468 of file Logic.cpp.

469{
470 m_history_head = 0;
471 m_history_count = std::min(initial_values.size(), m_history_size);
472
473 for (size_t i = 0; i < m_history_count; ++i) {
474 m_history_ring[i] = initial_values[i];
475 }
476}
size_t m_history_size
Maximum size of the history buffer.
Definition Logic.hpp:574
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

References m_history_count, m_history_head, m_history_ring, and m_history_size.