9 #ifndef __PDG_EventQueue_h__
10 #define __PDG_EventQueue_h__
25 #define PDG_EVENT_QUEUE_STATS 0
95 {
return myIsConsolidateEvents; }
99 { myIsConsolidateEvents = consolidate; }
130 struct DeferredEmitterUpdate
137 EmitterUpdate myType;
141 using EventInfo = std::pair<
144 using EventQueue = UT_ConcurrentQueue<EventInfo>;
148 using EmitterUpdateArray = UT_ConcurrentVector<DeferredEmitterUpdate>;
157 const EventArray& events);
165 const EventArray& myEvents;
175 bool addEventHandler(
179 void removeEventHandler(
182 void removeAllEventHandlers(
185 void findEventHandlers(
189 void processQueueStats(
int print_limit);
191 const EventInfo& info,
193 void processEvents();
196 { myPauseRequests.add(1); }
198 { myPauseRequests.add(-1); }
200 static void* runThread(
void*
param);
204 EmitterArrayMap myEmitters;
205 EmitterUpdateArray myEmitterUpdates;
206 ActiveEmitter myActiveEmitter;
210 #if PDG_EVENT_QUEUE_STATS
211 exint myDropEventCount;
212 exint myQueuedEventCount;
213 exint myPoppedEventCount;
214 exint myProcessedEventCount;
215 exint myQueueLogTime;
218 exint myEmitterMapSize;
221 bool myIsTerminating;
224 bool myIsConsolidateEvents;
bool isConsolidateEvents() const
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the queue
#define UT_ConcurrentHashMap
void setConsolidateEvents(bool consolidate)
Configures the event consolidation flag.
void pause(int delay) noexcept
ScopedPause(PDG_EventQueue *queue)
ImageBuf OIIO_API add(Image_or_Const A, Image_or_Const B, ROI roi={}, int nthreads=0)
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter