Last change
on this file since 1759 was 1759, checked in by aubourg, 24 years ago |
on rechange les include stl pour !&@@ SGI.
|
File size:
1.5 KB
|
Line | |
---|
1 | // This may look like C code, but it is really -*- C++ -*-
|
---|
2 |
|
---|
3 | // ArchTOIPipe (C) CEA/DAPNIA/SPP IN2P3/LAL
|
---|
4 | // Eric Aubourg
|
---|
5 | // Christophe Magneville
|
---|
6 | // Reza Ansari
|
---|
7 | // $Id: toimanager.h,v 1.10 2001-11-13 15:47:26 aubourg Exp $
|
---|
8 |
|
---|
9 |
|
---|
10 | #ifndef TOIMANAGER_H
|
---|
11 | #define TOIMANAGER_H
|
---|
12 |
|
---|
13 | #include <string>
|
---|
14 | #include <vector.h>
|
---|
15 |
|
---|
16 | using namespace std;
|
---|
17 |
|
---|
18 | class TOIManager {
|
---|
19 | public:
|
---|
20 | static TOIManager* getManager();
|
---|
21 | void setRequestedSample(int begin, int end);
|
---|
22 | int getRequestedBegin();
|
---|
23 | int getRequestedEnd();
|
---|
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 |
|
---|
36 | // -----------------------------------------------------------------
|
---|
37 | // Classe pour affichage de l'avancement des TOIProcessors
|
---|
38 | // Reza 08/2001
|
---|
39 | // -----------------------------------------------------------------
|
---|
40 |
|
---|
41 | class RzProcSampleCounter {
|
---|
42 | public:
|
---|
43 | RzProcSampleCounter();
|
---|
44 | virtual ~RzProcSampleCounter();
|
---|
45 | virtual long ProcessedSampleCount() = 0;
|
---|
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:
|
---|
57 | ProcSampleCounter(const T & t) { _t = &t; }
|
---|
58 | virtual long ProcessedSampleCount()
|
---|
59 | { return _t->ProcessedSampleCount(); }
|
---|
60 | protected:
|
---|
61 | const T * _t;
|
---|
62 | };
|
---|
63 |
|
---|
64 | #endif
|
---|
65 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.