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

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

re-correction du bug getMaxIn

File size: 1.3 KB
RevLine 
[1365]1// This may look like C code, but it is really -*- C++ -*-
2
3#ifndef TOIMANAGER_H
4#define TOIMANAGER_H
5
[1687]6#include <string>
[1365]7#include <vector>
8
[1410]9using namespace std;
10
[1365]11class TOIManager {
12public:
13 static TOIManager* getManager();
[1702]14 void setRequestedSample(int begin, int end);
15 int getRequestedBegin();
16 int getRequestedEnd();
[1365]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
[1687]29// -----------------------------------------------------------------
30// Classe pour affichage de l'avancement des TOIProcessors
31// Reza 08/2001
32// -----------------------------------------------------------------
33
34class RzProcSampleCounter {
35public:
[1702]36 RzProcSampleCounter();
[1687]37 virtual ~RzProcSampleCounter();
[1702]38 virtual long ProcessedSampleCount() = 0;
[1687]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:
[1702]50 ProcSampleCounter(const T & t) { _t = &t; }
51 virtual long ProcessedSampleCount()
52 { return _t->ProcessedSampleCount(); }
[1687]53protected:
54 const T * _t;
55};
56
[1365]57#endif
[1702]58
Note: See TracBrowser for help on using the repository browser.