// This may look like C code, but it is really -*- C++ -*- #ifndef TOIMANAGER_H #define TOIMANAGER_H #include using namespace std; class TOIManager { public: static TOIManager* getManager(); void setRequestedSample(long begin, long end); long getRequestedBegin(); long getRequestedEnd(); void addThread(pthread_t*); void joinAll(); protected: TOIManager(); static TOIManager* instance; long reqBegin; long reqEnd; vector threads; }; // ----------------------------------------------------------------- // Classe pour affichage de l'avancement des TOIProcessors // Reza 08/2001 // ----------------------------------------------------------------- class RzProcSampleCounter { public: RzProcSampleCounter(); virtual ~RzProcSampleCounter(); virtual long ProcessedSampleCount() = 0; virtual long PrintStats(); inline int & PrintRate(int pr) { return _rate; } inline string& InfoMessage() { return _msg; } protected: int _rate; string _msg; }; template class ProcSampleCounter : public RzProcSampleCounter { public: ProcSampleCounter(const T & t) { _t = &t; } virtual long ProcessedSampleCount() { return _t->ProcessedSampleCount(); } protected: const T * _t; }; #endif