Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

VrTestCopySlow.h

Go to the documentation of this file.
00001 /* -*- Mode: c++ -*- 00002 * 00003 * Copyright 1997 Massachusetts Institute of Technology 00004 * 00005 * Permission to use, copy, modify, distribute, and sell this software and its 00006 * documentation for any purpose is hereby granted without fee, provided that 00007 * the above copyright notice appear in all copies and that both that 00008 * copyright notice and this permission notice appear in supporting 00009 * documentation, and that the name of M.I.T. not be used in advertising or 00010 * publicity pertaining to distribution of the software without specific, 00011 * written prior permission. M.I.T. makes no representations about the 00012 * suitability of this software for any purpose. It is provided "as is" 00013 * without express or implied warranty. 00014 * 00015 */ 00016 00017 00018 #ifndef _VRTESTCOPYSLOW_H_ 00019 #define _VRTESTCOPYSLOW_H_ 00020 00021 #include <VrSource.h> 00022 00023 template<class iType, class oType> 00024 class VrTestCopySlow : public VrSigProc<iType,oType> { 00025 public: 00026 virtual void work(timestamp ts, unsigned int size, iType *i[], oType *o[]); 00027 virtual void initialize(); 00028 }; 00029 00030 template<class iType, class oType> void 00031 VrTestCopySlow<iType, oType>::initialize() 00032 { 00033 setOutputSize (1); 00034 } 00035 00036 template<class iType, class oType> void 00037 VrTestCopySlow<iType, oType>::work(timestamp ts, unsigned int size, iType *i[], oType *o[]) 00038 { 00039 00040 while(size-- > 0) { 00041 //waste some time 00042 int n=ts; 00043 for(int ii=0; ii<1000;ii++) 00044 n += n % 13; 00045 00046 *o[0]++= (oType) *i[0]++; 00047 } 00048 // fprintf ("%ld complete[%d]\n", ts, pthread_self()); 00049 } 00050 00051 #endif 00052 00053 00054 00055 00056

Generated on Wed Aug 4 02:22:06 2004 for GNU Radio by doxygen 1.3.8