Revision 1926,
980 bytes
checked in by mattausch, 18 years ago
(diff) |
worked on preprocessor with and without qt and threads
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #ifndef __PREPROCESSOR_THREAD_H
|
---|
2 | #define __PREPROCESSOR_THREAD_H
|
---|
3 |
|
---|
4 | #include <vector>
|
---|
5 | using namespace std;
|
---|
6 | namespace GtpVisibilityPreprocessor
|
---|
7 | {
|
---|
8 |
|
---|
9 | class Preprocessor;
|
---|
10 |
|
---|
11 |
|
---|
12 | /** This class represents a preprocessor thread.
|
---|
13 | */
|
---|
14 | class PreprocessorThread
|
---|
15 | {
|
---|
16 | public:
|
---|
17 | static vector<PreprocessorThread *> sThreads;
|
---|
18 |
|
---|
19 | PreprocessorThread(Preprocessor *p);
|
---|
20 | virtual ~PreprocessorThread();
|
---|
21 |
|
---|
22 | virtual void InitThread()
|
---|
23 | {
|
---|
24 | sThreads.push_back(this);
|
---|
25 | }
|
---|
26 |
|
---|
27 | virtual void RunThread() {}
|
---|
28 |
|
---|
29 | virtual void Main();
|
---|
30 |
|
---|
31 | // This function has to be defined by the thread library used...
|
---|
32 | virtual int GetCurrentThreadId() const = 0;
|
---|
33 |
|
---|
34 | protected:
|
---|
35 |
|
---|
36 | Preprocessor *mPreprocessor;
|
---|
37 | };
|
---|
38 |
|
---|
39 |
|
---|
40 | class DummyPreprocessorThread: public PreprocessorThread
|
---|
41 | {
|
---|
42 | public:
|
---|
43 |
|
---|
44 | DummyPreprocessorThread(Preprocessor *p): PreprocessorThread(p)
|
---|
45 | {}
|
---|
46 |
|
---|
47 | // This function has to be defined by the thread library used...
|
---|
48 | virtual int GetCurrentThreadId() const
|
---|
49 | {
|
---|
50 | return 0;
|
---|
51 | }
|
---|
52 | };
|
---|
53 |
|
---|
54 | }
|
---|
55 |
|
---|
56 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.