//# IO.h: Basic classes and global functions for IO and object persistency //# Copyright (C) 1995,1996,1999,2001 //# Associated Universities, Inc. Washington DC, USA. //# //# This library is free software; you can redistribute it and/or modify it //# under the terms of the GNU Library General Public License as published by //# the Free Software Foundation; either version 2 of the License, or (at your //# option) any later version. //# //# This library is distributed in the hope that it will be useful, but WITHOUT //# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or //# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public //# License for more details. //# //# You should have received a copy of the GNU Library General Public License //# along with this library; if not, write to the Free Software Foundation, //# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. //# //# Correspondence concerning AIPS++ should be addressed as follows: //# Internet email: aips2-request@nrao.edu. //# Postal address: AIPS++ Project Office //# National Radio Astronomy Observatory //# 520 Edgemont Road //# Charlottesville, VA 22903-2475 USA //# //# $Id$ #ifndef CASA_IO_H #define CASA_IO_H #include //# Includes for object persistency. #include #include //# Includes for general IO. #include //# Includes for underlying IO classes. #include #include #include #include #include #include #include namespace casacore { //# NAMESPACE CASACORE - BEGIN // // // Basic classes and global functions for IO and object persistency // // // // // This module provides the basic IO functionality for the Casacore classes. // There are two IO mechanisms: //
    //
  1. Class AipsIO // provides the object persistency mechanism. // The templated global functions in // AipsIOCarray.h // form a little layer upon AipsIO. They provide the means to put or // get a C-style array of any type. //
  2. Class ByteSinkSource // and its ancestors provide a general IO mechanism. //
// // Both use the underlying IO framework which define where and how // the data are written. The how-part is defined by classes derived from // TypeIO as shown // in the UML diagram. // There are three such classes: //
    //
  1. CanonicalIO reads/writes // data in canonical (machine-independent) format. This should be // used when data are meant to be exportable. // It uses the conversion functions in class // CanonicalConversion // . //
  2. RawIO reads/writes // data in native (machine-dependent) format. This can be used when // data are not exported. //
  3. ConversionIO // reads/writes in an external format as defined at construction time. // This can be used when the external format can be one of several // (e.g. VAX or IBM for a WSRT archive tape). In this way the // format has to be defined only once and thereafter is it handled // correctly by the polymorphism mechanism. //
// The where-part is defined by classes derived from // ByteIO as shown // in the UML diagram. // There are a few such classes: //
    //
  1. RegularFileIO uses a // regular file to hold the data. Internally it uses FilebufIO (see below). // It can handle files > 2 GB. //
  2. FilebufIO does the IO // in a buffered way similar to the stdio system. However, it // does not use stdio because that gave problems when doing concurrent // access from multiple processes. // It can handle files > 2 GB. //
  3. FiledesIO uses the // UNIX IO-functions like open, read to do IO directly. // It does not use an internal buffer. Instead it always does // physical IO. It is meant for IO operations where large chunks of // a file are accessed and for IO on sockets, pipes, etc.. // It can handle files > 2 GB. //
  4. StreamIO for IO // on a socket. //
  5. TapeIO for IO on a tape // device. //
  6. MemoryIO uses a // (possibly expandable) buffer in memory to hold the data. //
  7. MMapIO uses memory-mapped IO. // Be careful to use this on 32-bit machines, because its address space is // too small to handle a file of a few GBytes. //
  8. MFFileIO uses a virtual // file in a MultiFile // container file. MultiFile is meant to combine multiple files in // a single physical file to reduce the number of files used by // the Casacore table system. //
// // The IO framework is easily expandable. One can for instance think of a // class AsciiIO derived from TypeIO // to hold data in ASCII format. // A class RemoteTapeIO could be developed for IO on a tape // device on another node. //
//
} //# NAMESPACE CASACORE - END #endif