source: Sophya/trunk/ArchTOIPipe/Kernel/toimanager.h@ 1721

Last change on this file since 1721 was 1702, checked in by aubourg, 24 years ago

re-correction du bug getMaxIn

File size: 1.3 KB
Line 
1// This may look like C code, but it is really -*- C++ -*-
2
3#ifndef TOIMANAGER_H
4#define TOIMANAGER_H
5
6#include <string>
7#include <vector>
8
9using namespace std;
10
11class TOIManager {
12public:
13 static TOIManager* getManager();
14 void setRequestedSample(int begin, int end);
15 int getRequestedBegin();
16 int getRequestedEnd();
17 void addThread(pthread_t*);
18 void joinAll();
19
20protected:
21 TOIManager();
22 static TOIManager* instance;
23 long reqBegin;
24 long reqEnd;
25
26 vector<pthread_t*> threads;
27};
28
29// -----------------------------------------------------------------
30// Classe pour affichage de l'avancement des TOIProcessors
31// Reza 08/2001
32// -----------------------------------------------------------------
33
34class RzProcSampleCounter {
35public:
36 RzProcSampleCounter();
37 virtual ~RzProcSampleCounter();
38 virtual long ProcessedSampleCount() = 0;
39 virtual long PrintStats();
40 inline int & PrintRate(int pr) { return _rate; }
41 inline string& InfoMessage() { return _msg; }
42protected:
43 int _rate;
44 string _msg;
45};
46
47template <class T>
48class ProcSampleCounter : public RzProcSampleCounter {
49public:
50 ProcSampleCounter(const T & t) { _t = &t; }
51 virtual long ProcessedSampleCount()
52 { return _t->ProcessedSampleCount(); }
53protected:
54 const T * _t;
55};
56
57#endif
58
Note: See TracBrowser for help on using the repository browser.