Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

debugf.h

Go to the documentation of this file.
00001 // SPUC - Signal processing using C++ - A DSP library
00002 /* 
00003  * This program is free software; you can redistribute it and/or modify
00004  * it under the terms of the GNU General Public License as published by
00005  * the Free Software Foundation; either version 2, or (at your option)
00006  * any later version.
00007  * 
00008  * This program is distributed in the hope that it will be useful,
00009  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00010  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00011  * GNU General Public License for more details.
00012  * 
00013  * You should have received a copy of the GNU General Public License
00014  * along with this program; if not, write to the Free Software
00015  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
00016 */
00017 #ifndef DEBUGF
00018 #define DEBUGF
00019 #include <iostream.h>
00020 #include <fstream.h>
00021 #include <complex.h>
00022 namespace SPUC {
00026 class debugf {
00027 
00028  private:
00029   ofstream outf;
00030  public:
00031   debugf(const char* name) :  outf(name) {      ;   }
00032   ~debugf() {}
00033   void out(double x) { outf << x << " "; }
00034   void out(long x) { outf << x << " "; }
00035   void newline() { outf << "\n"; }
00036   void close() { outf.close(); }
00037   template <class T> void out(cmplx<T> x) { 
00038         outf << real(x) << " " << imag(x) << " ";
00039   }
00040   template <class T> void outn(T x) {
00041         out(x);
00042         outf << "\n";
00043   }
00044   template <class T> friend void operator <<(debugf r, const T x)  {
00045           r.out(x);
00046   }
00047 };
00048 }
00049 #endif

Generated on Fri Sep 16 11:02:30 2005 for spuc by  doxygen 1.4.4