Horus Doc || C++ Reference || Class Overview   Pixels   Images   Detector   Geometry   Registry || Doxygen's quick Index  

VxFrmFtorDoubleToDisk.h

00001 /*
00002  *
00003  *  Copyright (c) 2001, TNO TPD, The Netherlands.
00004  *  All rights reserved. No part of this software may be handed to or used by persons 
00005  *  or organisation outside Kenniscentrum Watergraafsmeer (UvA-ISIS, TNO TPD) without 
00006  *  the written permission of TNO TPD.
00007  *
00008  *  Author(s):
00009  *      Jan Baan (baan@tpd.tno.nl)
00010  *      Jeroen Vendrig
00011  *
00012  * 
00013  */
00014 
00015 #ifndef VxFrmFtorToFile_h
00016 #define VxFrmFtorToFile_h
00017 
00018 
00019 #include "VxFrmFtorUfo.h"
00020 #include <fstream>
00021 
00022 template<class T>
00023 class VxFrmFtorToFile : public VxFrmFtorUfo {
00024 public:
00025     VxFrmFtorToFile(HxString filename){
00026         _out=new STD_OFSTREAM(filename.c_str());
00027         if (!*_out)
00028             STD_CERR << "Error in VxFrmFtorToFile, constructor: could not open " << filename << STD_ENDL;
00029         //*_out << "# value" << STD_ENDL;
00030     }
00031 
00032     VxFrmFtorToFile(STD_OFSTREAM* out) : _out(out) {
00033     }
00034     
00035     ~VxFrmFtorToFile()
00036     {
00037         _out->close();
00038         delete _out;
00039     }
00040     
00041     virtual VxValue         doIt(int frame, const VxValue& input) {
00042         if (input.isNull())
00043             return VxValue();
00044         T val;
00045         input.get(val);
00046         
00047         *_out << frame << " " << val << STD_ENDL;
00048         
00049         return VxValue((int) 0);
00050     };
00051         
00052     virtual HxString        getInputClass() const {
00053         return HxClassName<T>();
00054     }
00055     virtual HxString        getOutputClass() const {
00056         return HxString("int");
00057     }
00058 
00059     virtual VxFrmFtorUfo*   clone() const {
00060         return new VxFrmFtorToFile(_out);
00061     }
00062     
00063     
00064 private:    
00065     STD_OFSTREAM*       _out;
00066     
00067 };
00068 
00069 
00070 #endif

Generated on Tue Feb 3 14:18:45 2004 for C++Reference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001