// This may look like C code, but it is really -*- C++ -*- // ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL // Eric Aubourg // Christophe Magneville // Reza Ansari // $Id: toimanager.h,v 1.9 2001-11-08 15:47:46 aubourg Exp $ #ifndef TOIMANAGER_H #define TOIMANAGER_H #include #include using namespace std; class TOIManager { public: static TOIManager* getManager(); void setRequestedSample(int begin, int end); int getRequestedBegin(); int 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