VrHistoryProc.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
#ifndef _VRHISTORYPROC_H_
00019
#define _VRHISTORYPROC_H_
00020
00021
#include <VrSigProc.h>
00022
00023
00024
00025
template<
class iType,
class oType>
00026 class VrHistoryProc :
public VrSigProc {
00027
protected:
00028 unsigned int history;
00029
00030
public:
00031 VrHistoryProc(
int outputs) :
VrSigProc(outputs, sizeof(
iType), sizeof(
oType)), history(1) {}
00032
virtual int forecast(
VrSampleRange output,
00033
VrSampleRange inputs[]);
00034
virtual unsigned int mapSizeUp(
int i,
unsigned int size);
00035 virtual ~VrHistoryProc() {}
00036 };
00037
00038
template<
class iType,
class oType>
int
00039 VrHistoryProc<iType,oType>::forecast(
VrSampleRange output,
00040
VrSampleRange inputs[]) {
00041
00042
for(
unsigned int i=0;i<numberInputs;i++) {
00043 inputs[i].
index=output.
index;
00044 inputs[i].
size=output.
size +
history-1;
00045 }
00046
return 0;
00047 }
00048
00049
template<
class iType,
class oType>
unsigned int
00050 VrHistoryProc<iType,oType>::mapSizeUp(
int i,
unsigned int size) {
00051
return (
unsigned int) (size *
00052 (
getUpstreamModuleN(i)->
getSamplingFrequency()
00053 /
getSamplingFrequency())+
history-1);
00054 }
00055
#endif
Generated on Wed Aug 4 02:22:05 2004 for GNU Radio by
1.3.8