19 #ifndef _geventqueue_h 20 #define _geventqueue_h 25 #include <QReadWriteLock> 48 class GEventQueue :
public QObject {
57 static GEventQueue* instance();
63 int getEventMask()
const;
75 bool isAcceptingEvent(
const GEvent& event)
const;
76 bool isAcceptingEvent(
int type)
const;
83 void setEventMask(
int mask);
100 Q_DISABLE_COPY(GEventQueue)
108 void enqueueEvent(
const GEvent& event);
109 bool isEmpty()
const;
111 void runOnQtGuiThreadAsync(
GThunk thunk);
112 void runOnQtGuiThreadSync(
GThunk thunk);
114 static GEventQueue* _instance;
115 std::queue<GThunk> _functionQueue;
116 std::queue<GEvent> _eventQueue;
117 QReadWriteLock _eventQueueMutex;
118 QReadWriteLock _functionQueueMutex;
121 friend class GObservable;
122 friend class GThread;
128 #endif // _geventqueue_h
GEvent waitForEvent(int mask=ANY_EVENT)
Dismisses the process until an event occurs whose type is covered by the event mask.
Definition: geventqueue.cpp:176
GEvent getNextEvent(int mask=ANY_EVENT)
Checks to see if there are any events of the desired type waiting on the event queue.
Definition: geventqueue.cpp:163
std::function< void()> GThunk
An alias for a function wrapper around a void function with no parameters and no return.
Definition: gtypes.h:30