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;
18 class PyInterp_Dispatcher : protected QThread
20 PyInterp_Dispatcher(); // private constructor
23 static PyInterp_Dispatcher* Get();
25 virtual ~PyInterp_Dispatcher();
28 void Exec( PyInterp_Request* );
32 void processRequest( PyInterp_Request* );
33 void objectDestroyed( const QObject* );
36 typedef PyInterp_Request* RequestPtr;
38 QQueue<RequestPtr> myQueue;
40 PyInterp_Watcher* myWatcher;
42 static PyInterp_Dispatcher* myInstance;
44 friend class PyInterp_Watcher;
47 #endif // PYINTERP_DISPATCHER_H