00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef _GRCIRCULARSINK_H_
00023 #define _GRCIRCULARSINK_H_
00024
00025
00026
00027
00028
00029
00030 #include <VrSink.h>
00031 #include <gr_circular_file.h>
00032
00033
00034 template <class iType>
00035 class GrCircularSink : public VrSink<iType>
00036 {
00037 private:
00038 gr_circular_file *d_circ_file;
00039
00040 public:
00041 GrCircularSink (const char *filename, int buffersize_in_bytes){
00042 d_circ_file = new gr_circular_file (filename, true, buffersize_in_bytes);
00043 }
00044
00045 ~GrCircularSink () {
00046 delete d_circ_file;
00047 }
00048
00049 const char *name () { return "GrCircularSink.h"; }
00050
00051 virtual int work3 (VrSampleRange output,
00052 VrSampleRange inputs[], void *ai[]){
00053
00054 iType *in = ((iType **) ai)[0];
00055
00056 d_circ_file->write (in, output.size * sizeof (iType));
00057 return output.size;
00058 }
00059 };
00060
00061
00062
00063 #endif