dataio.h

Go to the documentation of this file.
00001 /* Gxsm - Gnome X Scanning Microscopy
00002  * universal STM/AFM/SARLS/SPALEED/... controlling and
00003  * data analysis software
00004  * 
00005  * Copyright (C) 1999,2000,2001,2002,2003 Percy Zahl
00006  *
00007  * Authors: Percy Zahl <zahl@users.sf.net>
00008  * additional features: Andreas Klust <klust@users.sf.net>
00009  * WWW Home: http://gxsm.sf.net
00010  *
00011  * This program is free software; you can redistribute it and/or modify
00012  * it under the terms of the GNU General Public License as published by
00013  * the Free Software Foundation; either version 2 of the License, or
00014  * (at your option) any later version.
00015  *
00016  * This program is distributed in the hope that it will be useful,
00017  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019  * GNU General Public License for more details.
00020  *
00021  * You should have received a copy of the GNU General Public License
00022  * along with this program; if not, write to the Free Software
00023  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00024  */
00025 
00026 /* -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 8 c-style: "K&R" -*- */
00027 
00028 #ifndef __DATAIO_H
00029 #define __DATAIO_H
00030 
00031 #include <netcdf.hh>
00032 
00033 typedef enum { 
00034     FIO_OK, 
00035     FIO_OPEN_ERR, FIO_WRITE_ERR, FIO_READ_ERR,
00036     FIO_NO_NAME,
00037     FIO_NO_MEM,
00038     FIO_DISK_FULL,
00039     FIO_NO_DATFILE,
00040     FIO_NO_GNUFILE,
00041     FIO_NO_NETCDFFILE,
00042     FIO_NO_NETCDFXSMFILE,
00043     FIO_NSC_ERR,
00044     FIO_NOT_RESPONSIBLE_FOR_THAT_FILE,
00045     FIO_INVALID_FILE,
00046     FIO_UNKNOWN_ERR
00047 } FIO_STATUS;
00048 
00049 class Dataio{
00050  public:
00051   Dataio(Scan *s, const char *n){ scan=s; name=strdup(n); status=FIO_OK; };
00052   virtual ~Dataio(){ free(name); };
00053   void SetName(const char *n){ free(name); name=strdup(n); }
00054 
00055   virtual FIO_STATUS Read()=0;
00056   virtual FIO_STATUS Write()=0;
00057   void SetScan(Scan *sc){ scan = sc; };
00058 
00059   const char* ioStatus();
00060   char *name;
00061 
00062  protected:
00063   FIO_STATUS status;
00064   Scan *scan;
00065 };
00066 
00067 class NetCDF : public Dataio{
00068  public:
00069   NetCDF(Scan *s, const char *n) : Dataio(s,n){ };
00070   virtual FIO_STATUS Read();
00071   virtual FIO_STATUS Write();
00072 };
00073 
00074 
00075 #endif

Generated on Sat Apr 1 09:03:53 2006 for GXSM by  doxygen 1.4.6