source: Sophya/trunk/ArchTOIPipe/ProcWSophya/genwproc.h@ 1495

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

1ere version de genwproc rz+cmv 15/5/01

File size: 1.9 KB
Line 
1// This may look like C code, but it is really -*- C++ -*-
2
3#ifndef GENWPROC_H
4#define GENWPROC_H
5
6#include "toiprocessor.h"
7#include "tvector.h"
8
9#include <vector>
10
11
12class GenWindowTOIProcessor : public TOIProcessor {
13public:
14 GenWindowTOIProcessor(int nbinput,int nboutput,int wsz, int wstep=1, int wsztot=-1);
15 ~GenWindowTOIProcessor();
16
17 inline int_8 GetWSize() const { return WSize; }
18 inline int_8 GetWStep() const { return WStep; }
19 inline int_8 ProcessedSampleCount() const { return TotNsCount; }
20
21 inline int_8 GetStartSample() {return StartSample;}
22 inline int_8 GetCenterSample() {return StartSample + WSize/2;}
23 TVector<r_8> GetWData(int numtoi=0);
24 TVector<int_8> GetWFlag(int numtoi=0);
25 void PutWData(int numtoi,int_8 numsample,TVector<r_8>& data,TVector<int_8>& flag);
26 void PutWData(int numtoi,int_8 numsample,r_8 data,int_8 flag);
27 inline void PutWData(int_8 numsample,TVector<r_8>& data,TVector<int_8>& flag)
28 {PutWData(0,numsample,data,flag);}
29 inline void PutWData(int_8 numsample,r_8 data,int_8 flag)
30 {PutWData(0,numsample,data,flag);}
31
32 virtual void PrintStatus(ostream & os);
33
34 virtual void UserInit();
35 virtual void UserProc();
36 virtual void UserEnd();
37
38 virtual void init();
39 virtual void run();
40
41protected:
42 void Remplissage(int_8 ks);
43 inline int_8 StartSnIndex()
44 {if(CurSnInd<0) return -1; else return CurSnInd-WSize;}
45 inline int_8 CenterSnIndex()
46 {if(CurSnInd<0) return -1; else return CurSnInd-(WSize+1)/2;}
47
48 int NbInput,NbOutput;
49 int_8 WSizeTot,WSize,WStep;
50 int_8 SNdeb,SNend;
51 int_8 StartSample,CurSnInd;
52 int_8 TotNsCount;
53 vector< TVector<r_8> > WDataIn;
54 vector< TVector<int_8> > WFlagIn;
55 vector< TVector<r_8> > WDataOut;
56 vector< TVector<int_8> > WFlagOut;
57 vector< bool > WInFlg;
58 vector< bool > WOutFlg;
59 vector< bool > WPutOutFlg;
60 vector< int_8 > OutSample;
61};
62
63#endif
Note: See TracBrowser for help on using the repository browser.