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

Last change on this file since 1671 was 1653, checked in by cmv, 24 years ago

ajout include unistd.h pour sleep() sous Linux dans toimanager.cc
ajout include string sous Linux dans toimanager.h

cmv 21/9/01

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(long begin, long end);
15 long getRequestedBegin();
16 long 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// -----------------------------------------------------------------
31// Classe pour affichage de l'avancement des TOIProcessors
32// Reza 08/2001
33// -----------------------------------------------------------------
34
35class RzProcSampleCounter {
36public:
37 RzProcSampleCounter();
38 virtual ~RzProcSampleCounter();
39 virtual long ProcessedSampleCount() = 0;
40 virtual long PrintStats();
41 inline int & PrintRate(int pr) { return _rate; }
42 inline string& InfoMessage() { return _msg; }
43protected:
44 int _rate;
45 string _msg;
46};
47
48template <class T>
49class ProcSampleCounter : public RzProcSampleCounter {
50public:
51 ProcSampleCounter(const T & t) { _t = &t; }
52 virtual long ProcessedSampleCount()
53 { return _t->ProcessedSampleCount(); }
54protected:
55 const T * _t;
56};
57
58#endif
Note: See TracBrowser for help on using the repository browser.