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

Last change on this file since 1753 was 1738, checked in by aubourg, 24 years ago

copyright

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.9 2001-11-08 15:47:46 aubourg Exp $
8
9
10#ifndef TOIMANAGER_H
11#define TOIMANAGER_H
12
13#include <string>
14#include <vector>
15
16using namespace std;
17
18class TOIManager {
19public:
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
27protected:
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
41class RzProcSampleCounter {
42public:
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; }
49protected:
50 int _rate;
51 string _msg;
52};
53
54template <class T>
55class ProcSampleCounter : public RzProcSampleCounter {
56public:
57 ProcSampleCounter(const T & t) { _t = &t; }
58 virtual long ProcessedSampleCount()
59 { return _t->ProcessedSampleCount(); }
60protected:
61 const T * _t;
62};
63
64#endif
65
Note: See TracBrowser for help on using the repository browser.