26 #include "lv_common.h"
34 unsigned int get_event_priority (VisEvent
const& event)
39 struct EventPriorityLesser
41 bool operator() (VisEvent
const& event1, VisEvent
const& event2)
const
43 return get_event_priority (event1) < get_event_priority (event2);
49 class EventQueue::Impl
53 typedef std::priority_queue<Event, std::vector<Event>, EventPriorityLesser> Queue;
69 EventQueue::EventQueue ()
75 EventQueue::~EventQueue ()
80 bool EventQueue::poll (VisEvent& event)
82 if (!m_impl->events.empty ()) {
83 event = m_impl->events.top ();
84 m_impl->events.pop ();
91 void EventQueue::add (VisEvent
const& event)
93 m_impl->events.push (event);