00001 //# IO.h: Basic classes and global functions for IO and object persistency 00002 //# Copyright (C) 1995,1996,1999,2001 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 CASA_IO_H 00029 #define CASA_IO_H 00030 00031 #include <casacore/casa/aips.h> 00032 00033 //# Includes for object persistency. 00034 #include <casacore/casa/IO/AipsIO.h> 00035 #include <casacore/casa/IO/AipsIOCarray.h> 00036 00037 //# Includes for general IO. 00038 #include <casacore/casa/IO/ByteSinkSource.h> 00039 00040 //# Includes for underlying IO classes. 00041 #include <casacore/casa/IO/CanonicalIO.h> 00042 #include <casacore/casa/IO/RawIO.h> 00043 #include <casacore/casa/IO/RegularFileIO.h> 00044 #include <casacore/casa/IO/FilebufIO.h> 00045 #include <casacore/casa/IO/FiledesIO.h> 00046 #include <casacore/casa/IO/MemoryIO.h> 00047 #include <casacore/casa/IO/MFFileIO.h> 00048 00049 00050 namespace casacore { //# NAMESPACE CASACORE - BEGIN 00051 00052 // <module> 00053 00054 // <summary> 00055 // Basic classes and global functions for IO and object persistency 00056 // </summary> 00057 00058 // <reviewed reviewer="UNKNOWN" date="before2004/08/25" demos=""> 00059 // </reviewed> 00060 00061 // <synopsis> 00062 // This module provides the basic IO functionality for the Casacore classes. 00063 // There are two IO mechanisms: 00064 // <ol> 00065 // <li> Class <linkto class=AipsIO:description>AipsIO</linkto> 00066 // provides the object persistency mechanism. 00067 // The templated global functions in 00068 // <linkto file="AipsIOCarray.h#AipsIOCarray">AipsIOCarray.h</linkto> 00069 // form a little layer upon AipsIO. They provide the means to put or 00070 // get a C-style array of any type. 00071 // <li> Class <linkto class=ByteSinkSource:description>ByteSinkSource</linkto> 00072 // and its ancestors provide a general IO mechanism. 00073 // </ol> 00074 // 00075 // Both use the underlying IO framework which define where and how 00076 // the data are written. The how-part is defined by classes derived from 00077 // <linkto class=TypeIO:description>TypeIO</linkto> as shown 00078 // in the <a href=IO/IO_1.html>OMT diagram</a>. 00079 // There are three such classes: 00080 // <ol> 00081 // <li> <linkto class=CanonicalIO:description>CanonicalIO</linkto> reads/writes 00082 // data in canonical (machine-independent) format. This should be 00083 // used when data are meant to be exportable. 00084 // It uses the conversion functions in class 00085 // <linkto class=CanonicalConversion:description>CanonicalConversion 00086 // </linkto>. 00087 // <li> <linkto class=RawIO:description>RawIO</linkto> reads/writes 00088 // data in native (machine-dependent) format. This can be used when 00089 // data are not exported. 00090 // <li> <linkto class=ConversionIO:description>ConversionIO</linkto> 00091 // reads/writes in an external format as defined at construction time. 00092 // This can be used when the external format can be one of several 00093 // (e.g. VAX or IBM for a WSRT archive tape). In this way the 00094 // format has to be defined only once and thereafter is it handled 00095 // correctly by the polymorphism mechanism. 00096 // </ol> 00097 // The where-part is defined by classes derived from 00098 // <linkto class=ByteIO:description>ByteIO</linkto> as shown 00099 // in the <a href=IO/IO_2.html>OMT diagram</a>. 00100 // There are a few such classes: 00101 // <ol> 00102 // <li> <linkto class=RegularFileIO:description>RegularFileIO</linkto> uses a 00103 // regular file to hold the data. Internally it uses FilebufIO (see below). 00104 // It can handle files > 2 GB. 00105 // <li> <linkto class=FilebufIO:description>FilebufIO</linkto> does the IO 00106 // in a buffered way similar to the <src>stdio</src> system. However, it 00107 // does not use stdio because that gave problems when doing concurrent 00108 // access from multiple processes. 00109 // It can handle files > 2 GB. 00110 // <li> <linkto class=FiledesIO:description>FiledesIO</linkto> uses the 00111 // UNIX IO-functions like <src>open, read</src> to do IO directly. 00112 // It does not use an internal buffer. Instead it always does 00113 // physical IO. It is meant for IO operations where large chunks of 00114 // a file are accessed and for IO on sockets, pipes, etc.. 00115 // It can handle files > 2 GB. 00116 // <li> <linkto class=StreamIO:description>StreamIO</linkto> for IO 00117 // on a socket. 00118 // <li> <linkto class=TapeIO:description>TapeIO</linkto> for IO on a tape 00119 // device. 00120 // <li> <linkto class=MemoryIO:description>MemoryIO</linkto> uses a 00121 // (possibly expandable) buffer in memory to hold the data. 00122 // <li> <linkto class=MMapIO:description>MMapIO</linkto> uses memory-mapped IO. 00123 // Be careful to use this on 32-bit machines, because its address space is 00124 // too small to handle a file of a few GBytes. 00125 // <li> <linkto class=MFFileIO:description>MFFileIO</linkto> uses a virtual 00126 // file in a <linkto class=MultiFile:description>MultiFile</linkto> 00127 // container file. MultiFile is meant to combine multiple files in 00128 // a single physical file to reduce the number of files used by 00129 // the Casacore table system. 00130 // </ol> 00131 // 00132 // The IO framework is easily expandable. One can for instance think of a 00133 // class <src>AsciiIO</src> derived from <src>TypeIO</src> 00134 // to hold data in ASCII format. 00135 // A class <src>RemoteTapeIO</src> could be developed for IO on a tape 00136 // device on another node. 00137 // </synopsis> 00138 00139 // </module> 00140 00141 00142 00143 } //# NAMESPACE CASACORE - END 00144 00145 #endif 00146