source:
GTP/trunk/Lib/Vis/Preprocessing/src/PreprocessorThread.h
@
2176
Revision 2176, 967 bytes checked in by mattausch, 18 years ago (diff) | |
---|---|
|
Rev | Line | |
---|---|---|
[492] | 1 | #ifndef __PREPROCESSOR_THREAD_H |
2 | #define __PREPROCESSOR_THREAD_H | |
3 | ||
[1867] | 4 | #include <vector> |
[2176] | 5 | // |
[1146] | 6 | namespace GtpVisibilityPreprocessor |
7 | { | |
8 | ||
[492] | 9 | class Preprocessor; |
10 | ||
[1867] | 11 | |
[1145] | 12 | /** This class represents a preprocessor thread. |
13 | */ | |
[1146] | 14 | class PreprocessorThread |
[492] | 15 | { |
16 | public: | |
[2176] | 17 | static std::vector<PreprocessorThread *> sThreads; |
[1867] | 18 | |
[1926] | 19 | PreprocessorThread(Preprocessor *p); |
20 | virtual ~PreprocessorThread(); | |
[1867] | 21 | |
[1926] | 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 | ||
[1146] | 34 | protected: |
[1926] | 35 | |
36 | Preprocessor *mPreprocessor; | |
[492] | 37 | }; |
38 | ||
[1926] | 39 | |
40 | class DummyPreprocessorThread: public PreprocessorThread | |
[1154] | 41 | { |
[1926] | 42 | public: |
[1154] | 43 | |
[1926] | 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 | ||
[860] | 54 | } |
[492] | 55 | |
56 | #endif |
Note: See TracBrowser
for help on using the repository browser.