#ifndef __PREPROCESSOR_THREAD_H #define __PREPROCESSOR_THREAD_H #include // namespace GtpVisibilityPreprocessor { class Preprocessor; /** This class represents a preprocessor thread. */ class PreprocessorThread { public: static std::vector sThreads; PreprocessorThread(Preprocessor *p); virtual ~PreprocessorThread(); virtual void InitThread() { sThreads.push_back(this); } virtual void RunThread() {} virtual void Main(); // This function has to be defined by the thread library used... virtual int GetCurrentThreadId() const = 0; protected: Preprocessor *mPreprocessor; }; class DummyPreprocessorThread: public PreprocessorThread { public: DummyPreprocessorThread(Preprocessor *p): PreprocessorThread(p) {} // This function has to be defined by the thread library used... virtual int GetCurrentThreadId() const { return 0; } }; } #endif