IO
[casa core modules (libcasa)]


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 AIPS++ classes. There are two IO mechanisms:

  1. Class AipsIO provides the object persistency mechanism. The templated global functions in (see AipsIOCarray.h (file="AipsIOCarray.h::AipsIOCarray")) 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 is written. The how-part is defined by classes derived from TypeIO as shown in the OMT 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 OMT diagram. There are a few such classes:
  1. RegularFileIO uses a regular file to hold the data. Internally it uses FilebufIO (see below).
  2. FilebufIO uses the stdio system to do IO in a buffered way. It uses an internal buffer to do physical IO only when needed. See the description of C-functions like fopen, fread or do man stdio for more information.
  3. FiledesIO uses the UNIX IO-functions like open, read to do IO directly. It does not use an internal buffer. Instead it always do a physical IO. It is meant for IO operations where large chunks of a file are accessed and for IO on sockets, pipes, etc.\.
  4. MemoryIO uses a (possibly expandable) buffer in memory to hold the data.

The IO framework is easily expandable. Once can for instance think of a class AsciiIO derived from TypeIO to hold data in ASCII format.
A class TapeIO could be derived from ByteIO to access tape files. This class can also contain functions to skip to a tape file, which the user can call directly. Similarly a class RemoteTapeIO could be developed.


Modules

 IO_internal_classes
 Internal IO classes and functions.

Classes

class  casa::AipsIO
 AipsIO is the object persistency mechanism of AIPS++. More...
struct  casa::AipsIOCarray_global_functions_AipsIOCarray
 Templated functions to get/put a C-style array from/into AipsIO. More...
class  casa::BaseSinkSource
 Shared base class for ByteSink and ByteSource. More...
struct  casa::BucketCache_global_functions_BucketCache_CallBack
 Define the type of the static read and write function. More...
class  casa::BucketCache
 Cache for buckets in a part of a file. More...
class  casa::ByteIO
 Abstract base class for IO on a byte stream. More...
class  casa::ByteSink
 Class for write-only access to data in a given format. More...
class  casa::ByteSinkSource
 Class for read/write access to data in a given format. More...
class  casa::ByteSource
 Class for read-only access to data in a given format. More...
class  casa::CanonicalIO
 Class for IO in canonical format. More...
class  casa::ConversionIO
 Class for IO in a converted format. More...
class  casa::FilebufIO
 Class for buffered file IO. More...
class  casa::FiledesIO
 Class for IO on a file descriptor. More...
class  casa::FileLocker
 Class to handle file locking. More...
class  casa::LargeFilebufIO
 Class for buffered IO on a large file. More...
class  casa::LargeFiledesIO
 Class for IO on a large file descriptor. More...
class  casa::LargeRegularFileIO
 Class for IO on a regular large file. More...
class  casa::LECanonicalIO
 Class for IO in little endian canonical format. More...
class  casa::LockFile
 Class to handle file locking and synchronization. More...
class  casa::MemoryIO
 Class for IO to a memory buffer. More...
class  casa::RawIO
 Class for IO in local format. More...
class  casa::RegularFileIO
 Class for IO on a regular file. More...
class  casa::StreamIO
 Class for IO on connection oriented socket. More...
class  casa::TapeIO
 Class for IO on a tape device. More...
class  casa::TypeIO
 Abstract base class for IO of data in a type-dependent format. More...


Generated on Mon Sep 1 22:37:01 2008 for NRAOCASA by  doxygen 1.5.1