casacore
Modules | Classes

More...

Modules

 IO_module_internal_classes
 Internal IO_module classes and functions.
 

Classes

class  casacore::AipsIO
  More...
 
struct  casacore::AipsIOCarray_global_functions_AipsIOCarray
  More...
 
struct  casacore::ArrayIO_global_functions_Array_IO
  More...
 
struct  casacore::ArrayIO_global_functions_Array_binary_IO
 Global functions to read/write binary arrays from/to a file. More...
 
class  casacore::BaseSinkSource
  More...
 
class  casacore::BucketBuffered
  More...
 
struct  casacore::BucketCache_global_functions_BucketCache_CallBack
  More...
 
class  casacore::BucketCache
 Cache for buckets in a part of a file. More...
 
class  casacore::BucketMapped
  More...
 
class  casacore::ByteIO
  More...
 
class  casacore::ByteSink
  More...
 
class  casacore::ByteSinkSource
  More...
 
class  casacore::ByteSource
  More...
 
class  casacore::CanonicalIO
  More...
 
class  casacore::ConversionIO
  More...
 
class  casacore::FilebufIO
  More...
 
class  casacore::FiledesIO
  More...
 
class  casacore::FileLocker
  More...
 
class  casacore::LECanonicalIO
  More...
 
class  casacore::LockFile
  More...
 
class  casacore::MemoryIO
  More...
 
class  casacore::MFFileIO
  More...
 
class  casacore::MMapfdIO
  More...
 
class  casacore::MMapIO
  More...
 
class  casacore::MultiFile
  More...
 
struct  casacore::MultiFileBuffer
  More...
 
class  casacore::MultiFileBase
 
Abstract base class to combine multiple files in a single one. More...
 
class  casacore::MultiHDF5
  More...
 
class  casacore::RawIO
  More...
 
class  casacore::RegularFileIO
  More...
 
class  casacore::StreamIO
  More...
 
class  casacore::TapeIO
  More...
 
class  casacore::TypeIO
  More...
 

Detailed Description

Basic classes and global functions for IO and object persistency

See below for an overview of the classes in this module.

Review Status

Reviewed By:
UNKNOWN
Date Reviewed:
before2004/08/25

Synopsis

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.