26#ifndef SBL_CONTROL_EVENT_QUEUE_HPP_
27#define SBL_CONTROL_EVENT_QUEUE_HPP_
36template<
typename T, u
int32_t Size>
41 if (ring_.push(
event))
return true;
42 dropped_.store(dropped_.load(std::memory_order_relaxed) + 1,
43 std::memory_order_relaxed);
54 fn(
static_cast<const T&
>(
event));
63 bool empty()
const {
return ring_.empty(); }
72 std::atomic<uint32_t> dropped_{0};
static constexpr uint32_t capacity()
bool pop(T &event)
Consumer side. Pop one event; false if empty.
uint32_t dropped() const
Pushes rejected because the queue was full, since boot. Any context.
bool push(const T &event)
Producer side. Returns false (and counts a drop) if the queue is full.
Control Stack v2: scheduler, event queue, merge, CC mapping, calibration, presets.
Lock-free single-producer, single-consumer ring buffer.