#include "input.hpp" #include namespace panel { void Service::publish(int slot) { Slot& target = slots_[static_cast(slot)]; Frame frame; frame.serial = counters_.frames + 1; frame.slot = slot; frame.generation = target.generation; frame.events = target.pending; ledger_.push_back(std::move(frame)); counters_.committed_events += target.pending.size(); counters_.frames += 1; target.pending.clear(); } int Service::sync(int slot) { if (!valid_slot(slot)) { return -1; } Slot& target = slots_[static_cast(slot)]; if (target.phase != Phase::Registered) { return -2; } publish(slot); return 0; } }