Last change
on this file since 1760 was 1759, checked in by aubourg, 24 years ago |
on rechange les include stl pour !&@@ SGI.
|
File size:
1.5 KB
|
Rev | Line | |
---|
[1365] | 1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
| 2 |
|
---|
[1738] | 3 | // ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
|
---|
| 4 | // Eric Aubourg
|
---|
| 5 | // Christophe Magneville
|
---|
| 6 | // Reza Ansari
|
---|
[1759] | 7 | // $Id: toimanager.h,v 1.10 2001-11-13 15:47:26 aubourg Exp $
|
---|
[1738] | 8 |
|
---|
| 9 |
|
---|
[1365] | 10 | #ifndef TOIMANAGER_H
|
---|
| 11 | #define TOIMANAGER_H
|
---|
| 12 |
|
---|
[1687] | 13 | #include <string>
|
---|
[1759] | 14 | #include <vector.h>
|
---|
[1365] | 15 |
|
---|
[1410] | 16 | using namespace std;
|
---|
| 17 |
|
---|
[1365] | 18 | class TOIManager {
|
---|
| 19 | public:
|
---|
| 20 | static TOIManager* getManager();
|
---|
[1702] | 21 | void setRequestedSample(int begin, int end);
|
---|
| 22 | int getRequestedBegin();
|
---|
| 23 | int getRequestedEnd();
|
---|
[1365] | 24 | void addThread(pthread_t*);
|
---|
| 25 | void joinAll();
|
---|
| 26 |
|
---|
| 27 | protected:
|
---|
| 28 | TOIManager();
|
---|
| 29 | static TOIManager* instance;
|
---|
| 30 | long reqBegin;
|
---|
| 31 | long reqEnd;
|
---|
| 32 |
|
---|
| 33 | vector<pthread_t*> threads;
|
---|
| 34 | };
|
---|
| 35 |
|
---|
[1687] | 36 | // -----------------------------------------------------------------
|
---|
| 37 | // Classe pour affichage de l'avancement des TOIProcessors
|
---|
| 38 | // Reza 08/2001
|
---|
| 39 | // -----------------------------------------------------------------
|
---|
| 40 |
|
---|
| 41 | class RzProcSampleCounter {
|
---|
| 42 | public:
|
---|
[1702] | 43 | RzProcSampleCounter();
|
---|
[1687] | 44 | virtual ~RzProcSampleCounter();
|
---|
[1702] | 45 | virtual long ProcessedSampleCount() = 0;
|
---|
[1687] | 46 | virtual long PrintStats();
|
---|
| 47 | inline int & PrintRate(int pr) { return _rate; }
|
---|
| 48 | inline string& InfoMessage() { return _msg; }
|
---|
| 49 | protected:
|
---|
| 50 | int _rate;
|
---|
| 51 | string _msg;
|
---|
| 52 | };
|
---|
| 53 |
|
---|
| 54 | template <class T>
|
---|
| 55 | class ProcSampleCounter : public RzProcSampleCounter {
|
---|
| 56 | public:
|
---|
[1702] | 57 | ProcSampleCounter(const T & t) { _t = &t; }
|
---|
| 58 | virtual long ProcessedSampleCount()
|
---|
| 59 | { return _t->ProcessedSampleCount(); }
|
---|
[1687] | 60 | protected:
|
---|
| 61 | const T * _t;
|
---|
| 62 | };
|
---|
| 63 |
|
---|
[1365] | 64 | #endif
|
---|
[1702] | 65 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.