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 |
|
---|
12 | class GenWindowTOIProcessor : public TOIProcessor {
|
---|
13 | public:
|
---|
14 | GenWindowTOIProcessor(int nbinput,int nboutput,int wsz, int wstep=1, int wsztot=-1);
|
---|
15 | virtual ~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 | inline int_8 StartSampleNum() { return SNdeb; }
|
---|
24 | inline int_8 EndSampleNum() { return SNend; }
|
---|
25 |
|
---|
26 | inline void SetDefaultValue(r_8 r8dval=0., int_8 i8dval=0)
|
---|
27 | {R8DefVal = r8dval; I8DefVal = i8dval;}
|
---|
28 |
|
---|
29 | TVector<r_8> GetWData(int numtoi=0);
|
---|
30 | TVector<int_8> GetWFlag(int numtoi=0);
|
---|
31 | r_8 * GetWDataPointer(int numtoi=0);
|
---|
32 | int_8 * GetWFlagPointer(int numtoi=0);
|
---|
33 | void GetData(int numtoi, int_8 numsample, r_8 & data, int_8 & flag);
|
---|
34 | inline void GetData(int_8 numsample, r_8 & data, int_8 & flag)
|
---|
35 | { GetData(0, numsample, data, flag); }
|
---|
36 |
|
---|
37 | void PutWData(int numtoi,int_8 numsample,TVector<r_8>& data,TVector<int_8>& flag);
|
---|
38 | void PutWData(int numtoi,int_8 numsample,r_8 data,int_8 flag);
|
---|
39 | inline void PutWData(int_8 numsample,TVector<r_8>& data,TVector<int_8>& flag)
|
---|
40 | {PutWData(0,numsample,data,flag);}
|
---|
41 | inline void PutWData(int_8 numsample,r_8 data,int_8 flag)
|
---|
42 | {PutWData(0,numsample,data,flag);}
|
---|
43 |
|
---|
44 | virtual void PrintStatus(ostream & os);
|
---|
45 |
|
---|
46 | virtual void UserInit(int_8 kstart);
|
---|
47 | virtual void UserProc(int_8 ks);
|
---|
48 | virtual void UserEnd(int_8 kend);
|
---|
49 |
|
---|
50 | virtual void init();
|
---|
51 | virtual void run();
|
---|
52 |
|
---|
53 | protected:
|
---|
54 | void Remplissage(int_8 ks);
|
---|
55 | void Ecriture();
|
---|
56 | inline int_8 StartWtIndex()
|
---|
57 | {if(CurWtIndex<0) return -1; else return CurWtIndex-WSize;}
|
---|
58 | inline int_8 CenterWtIndex()
|
---|
59 | {if(CurWtIndex<0) return -1; else return CurWtIndex-(WSize+1)/2;}
|
---|
60 |
|
---|
61 | int NbInput,NbOutput;
|
---|
62 | int_8 WSizeTot,WSize,WStep;
|
---|
63 | int_8 SNdeb,SNend;
|
---|
64 | int_8 StartSample,CurWtIndex;
|
---|
65 | int_8 TotNsCount;
|
---|
66 | r_8 R8DefVal;
|
---|
67 | int_8 I8DefVal;
|
---|
68 | vector< TVector<r_8> > WDataIn;
|
---|
69 | vector< TVector<int_8> > WFlagIn;
|
---|
70 | vector< TVector<r_8> > WDataOut;
|
---|
71 | vector< TVector<int_8> > WFlagOut;
|
---|
72 | vector< bool > WInFlg;
|
---|
73 | vector< bool > WOutFlg;
|
---|
74 | vector< bool > WPutOutFlg;
|
---|
75 | vector< bool > WPutOutOwnVector;
|
---|
76 | vector< int_8 > OutSample;
|
---|
77 | };
|
---|
78 |
|
---|
79 | #endif
|
---|