2 #ifndef PYINTERP_DISPATCHER_H
3 #define PYINTERP_DISPATCHER_H
5 #include "PyInterp.h" // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
7 #include "PyInterp_Request.h" // full include instead of forward declaration
8 // everyone inc'ing the Dispatcher will get the requests for free.
15 class PyInterp_Watcher;
17 class PYINTERP_EXPORT PyInterp_Dispatcher : protected QThread
19 PyInterp_Dispatcher(); // private constructor
22 static PyInterp_Dispatcher* Get();
24 virtual ~PyInterp_Dispatcher();
27 void Exec( PyInterp_Request* );
31 void processRequest( PyInterp_Request* );
32 void objectDestroyed( const QObject* );
35 typedef PyInterp_Request* RequestPtr;
37 QQueue<RequestPtr> myQueue;
39 PyInterp_Watcher* myWatcher;
41 static PyInterp_Dispatcher* myInstance;
43 friend class PyInterp_Watcher;
46 #endif // PYINTERP_DISPATCHER_H