2#include <Process/Monitoring/Monitor.hpp>
4#include <ossia/detail/lockfree_queue.hpp>
25template <
typename T, std::
size_t N>
38 bool push(
const T& e)
noexcept
40 if(m_queue.try_enqueue(e))
42 m_dropped.fetch_add(1, std::memory_order_relaxed);
56 while(m_queue.try_dequeue(e))
68 while(m_queue.try_dequeue(e))
69 m_staged.push_back(e);
71 for(
const T& s : m_staged)
73 return int(m_staged.size());
76 uint64_t dropped() const noexcept {
return m_dropped.load(std::memory_order_relaxed); }
79 ossia::spsc_queue<T> m_queue;
80 std::atomic<uint64_t> m_dropped{0};
83 std::vector<T> m_staged;
Definition EventRing.hpp:27
bool push(const T &e) noexcept
Writer: false when the ring is full and e was dropped.
Definition EventRing.hpp:38
int drain(F &&f)
Definition EventRing.hpp:49
Base classes and tools to implement processes and layers.
Definition JSONVisitor.hpp:1115
uint64_t monitorFrame() noexcept
Definition MonitorLink.cpp:27