00001 //# TiledFileHelper.h: Helper class for tiled access to an array in a file 00002 //# Copyright (C) 2001,2002 00003 //# Associated Universities, Inc. Washington DC, USA. 00004 //# 00005 //# This library is free software; you can redistribute it and/or modify it 00006 //# under the terms of the GNU Library General Public License as published by 00007 //# the Free Software Foundation; either version 2 of the License, or (at your 00008 //# option) any later version. 00009 //# 00010 //# This library is distributed in the hope that it will be useful, but WITHOUT 00011 //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public 00013 //# License for more details. 00014 //# 00015 //# You should have received a copy of the GNU Library General Public License 00016 //# along with this library; if not, write to the Free Software Foundation, 00017 //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. 00018 //# 00019 //# Correspondence concerning AIPS++ should be addressed as follows: 00020 //# Internet email: aips2-request@nrao.edu. 00021 //# Postal address: AIPS++ Project Office 00022 //# National Radio Astronomy Observatory 00023 //# 520 Edgemont Road 00024 //# Charlottesville, VA 22903-2475 USA 00025 //# 00026 //# $Id$ 00027 00028 #ifndef TABLES_TILEDFILEHELPER_H 00029 #define TABLES_TILEDFILEHELPER_H 00030 00031 00032 //# Includes 00033 #include <casacore/casa/aips.h> 00034 #include <casacore/tables/DataMan/TiledStMan.h> 00035 #include <casacore/tables/Tables/TableDesc.h> 00036 00037 00038 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00039 00040 // <summary> 00041 // Helper class for tiled access to an array in a file. 00042 // </summary> 00043 00044 // <use visibility=local> 00045 00046 // <reviewed reviewer="" date="" tests="tTiledFileAccess.cc"> 00047 // </reviewed> 00048 00049 // <prerequisite> 00050 //# Classes you should understand before using this one. 00051 // <li> Description of Tiled Storage Manager in module file 00052 // <linkto module=Tables:TiledStMan>Tables.h</linkto> 00053 // </prerequisite> 00054 00055 // <synopsis> 00056 // TiledFileHelper is a helper class for class 00057 // <linkto class=TiledFileAccess>TiledFileAccess</linkto>. 00058 // It sets up a table description containing one array column 00059 // to make it possible to use the 00060 // <linkto class=TiledStMan>tiled storage manager</linkto> 00061 // to access an array in an arbitrary file. 00062 // </synopsis> 00063 00064 // <motivation> 00065 // This class was created to be able to read an image in a FITS file. 00066 // </motivation> 00067 00068 //# <todo asof="$DATE:$"> 00069 //# A List of bugs, limitations, extensions or planned refinements. 00070 //# </todo> 00071 00072 00073 class TiledFileHelper : public TiledStMan 00074 { 00075 public: 00076 // Create a TiledFileHelper object. 00077 // Tell if the data is stored in big or little endian canonical format. 00078 TiledFileHelper (const String& fileName, const IPosition& shape, 00079 DataType dtype, const TSMOption&, 00080 Bool writable, Bool bigEndian); 00081 00082 ~TiledFileHelper(); 00083 00084 virtual const TableDesc& getDesc() const; 00085 00086 TSMFile* file() 00087 { return fileSet_p[0]; } 00088 00089 // Return the class name. 00090 virtual String dataManagerType() const; 00091 00092 // These functions are pure virtual, but not needed here. 00093 // They throw an exception. 00094 // <group> 00095 virtual DataManager* clone() const; 00096 virtual Bool flush (AipsIO&, Bool); 00097 virtual void create (uInt); 00098 virtual TSMCube* getHypercube (uInt); 00099 virtual TSMCube* getHypercube (uInt, IPosition&); 00100 virtual void readHeader (uInt, Bool); 00101 // </group> 00102 00103 private: 00104 // Forbid copy constructor and assignment. 00105 // <group> 00106 TiledFileHelper (const TiledFileHelper&); 00107 TiledFileHelper& operator= (const TiledFileHelper&); 00108 // </group> 00109 00110 00111 TableDesc itsDesc; 00112 }; 00113 00114 00115 00116 } //# NAMESPACE CASACORE - END 00117 00118 #endif