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

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

copyright

File size: 1.5 KB
RevLine 
[1365]1// This may look like C code, but it is really -*- C++ -*-
2
[1738]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
[1365]10#ifndef TOIMANAGER_H
11#define TOIMANAGER_H
12
[1687]13#include <string>
[1365]14#include <vector>
15
[1410]16using namespace std;
17
[1365]18class TOIManager {
19public:
20 static TOIManager* getManager();
[1702]21 void setRequestedSample(int begin, int end);
22 int getRequestedBegin();
23 int getRequestedEnd();
[1365]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
[1687]36// -----------------------------------------------------------------
37// Classe pour affichage de l'avancement des TOIProcessors
38// Reza 08/2001
39// -----------------------------------------------------------------
40
41class RzProcSampleCounter {
42public:
[1702]43 RzProcSampleCounter();
[1687]44 virtual ~RzProcSampleCounter();
[1702]45 virtual long ProcessedSampleCount() = 0;
[1687]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:
[1702]57 ProcSampleCounter(const T & t) { _t = &t; }
58 virtual long ProcessedSampleCount()
59 { return _t->ProcessedSampleCount(); }
[1687]60protected:
61 const T * _t;
62};
63
[1365]64#endif
[1702]65
Note: See TracBrowser for help on using the repository browser.