casacore
Loading...
Searching...
No Matches
IO.h
Go to the documentation of this file.
1//# IO.h: Basic classes and global functions for IO and object persistency
2//# Copyright (C) 1995,1996,1999,2001
3//# Associated Universities, Inc. Washington DC, USA.
4//#
5//# This library is free software; you can redistribute it and/or modify it
6//# under the terms of the GNU Library General Public License as published by
7//# the Free Software Foundation; either version 2 of the License, or (at your
8//# option) any later version.
9//#
10//# This library is distributed in the hope that it will be useful, but WITHOUT
11//# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12//# FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
13//# License for more details.
14//#
15//# You should have received a copy of the GNU Library General Public License
16//# along with this library; if not, write to the Free Software Foundation,
17//# Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA.
18//#
19//# Correspondence concerning AIPS++ should be addressed as follows:
20//# Internet email: casa-feedback@nrao.edu.
21//# Postal address: AIPS++ Project Office
22//# National Radio Astronomy Observatory
23//# 520 Edgemont Road
24//# Charlottesville, VA 22903-2475 USA
25
26#ifndef CASA_IO_H
27#define CASA_IO_H
28
29#include <casacore/casa/aips.h>
30
31//# Includes for object persistency.
32#include <casacore/casa/IO/AipsIO.h>
33#include <casacore/casa/IO/AipsIOCarray.h>
34
35//# Includes for general IO.
36#include <casacore/casa/IO/ByteSinkSource.h>
37
38//# Includes for underlying IO classes.
39#include <casacore/casa/IO/CanonicalIO.h>
40#include <casacore/casa/IO/RawIO.h>
41#include <casacore/casa/IO/RegularFileIO.h>
42#include <casacore/casa/IO/FilebufIO.h>
43#include <casacore/casa/IO/FiledesIO.h>
44#include <casacore/casa/IO/MemoryIO.h>
45#include <casacore/casa/IO/MFFileIO.h>
46
47
48namespace casacore { //# NAMESPACE CASACORE - BEGIN
49
50// <module>
51
52// <summary>
53// Basic classes and global functions for IO and object persistency
54// </summary>
55
56// <reviewed reviewer="UNKNOWN" date="before2004/08/25" demos="">
57// </reviewed>
58
59// <synopsis>
60// This module provides the basic IO functionality for the Casacore classes.
61// There are two IO mechanisms:
62// <ol>
63// <li> Class <linkto class=AipsIO:description>AipsIO</linkto>
64// provides the object persistency mechanism.
65// The templated global functions in
66// <linkto file="AipsIOCarray.h#AipsIOCarray">AipsIOCarray.h</linkto>
67// form a little layer upon AipsIO. They provide the means to put or
68// get a C-style array of any type.
69// <li> Class <linkto class=ByteSinkSource:description>ByteSinkSource</linkto>
70// and its ancestors provide a general IO mechanism.
71// </ol>
72//
73// Both use the underlying IO framework which define where and how
74// the data are written. The how-part is defined by classes derived from
75// <linkto class=TypeIO:description>TypeIO</linkto> as shown
76// in the <a href=IO-framework.drawio.svg.html>UML diagram</a>.
77// There are three such classes:
78// <ol>
79// <li> <linkto class=CanonicalIO:description>CanonicalIO</linkto> reads/writes
80// data in canonical (machine-independent) format. This should be
81// used when data are meant to be exportable.
82// It uses the conversion functions in class
83// <linkto class=CanonicalConversion:description>CanonicalConversion
84// </linkto>.
85// <li> <linkto class=RawIO:description>RawIO</linkto> reads/writes
86// data in native (machine-dependent) format. This can be used when
87// data are not exported.
88// <li> <linkto class=ConversionIO:description>ConversionIO</linkto>
89// reads/writes in an external format as defined at construction time.
90// This can be used when the external format can be one of several
91// (e.g. VAX or IBM for a WSRT archive tape). In this way the
92// format has to be defined only once and thereafter is it handled
93// correctly by the polymorphism mechanism.
94// </ol>
95// The where-part is defined by classes derived from
96// <linkto class=ByteIO:description>ByteIO</linkto> as shown
97// in the <a href=IO-framework.drawio.svg.html>UML diagram</a>.
98// There are a few such classes:
99// <ol>
100// <li> <linkto class=RegularFileIO:description>RegularFileIO</linkto> uses a
101// regular file to hold the data. Internally it uses FilebufIO (see below).
102// It can handle files > 2 GB.
103// <li> <linkto class=FilebufIO:description>FilebufIO</linkto> does the IO
104// in a buffered way similar to the <src>stdio</src> system. However, it
105// does not use stdio because that gave problems when doing concurrent
106// access from multiple processes.
107// It can handle files > 2 GB.
108// <li> <linkto class=FiledesIO:description>FiledesIO</linkto> uses the
109// UNIX IO-functions like <src>open, read</src> to do IO directly.
110// It does not use an internal buffer. Instead it always does
111// physical IO. It is meant for IO operations where large chunks of
112// a file are accessed and for IO on sockets, pipes, etc..
113// It can handle files > 2 GB.
114// <li> <linkto class=StreamIO:description>StreamIO</linkto> for IO
115// on a socket.
116// <li> <linkto class=TapeIO:description>TapeIO</linkto> for IO on a tape
117// device.
118// <li> <linkto class=MemoryIO:description>MemoryIO</linkto> uses a
119// (possibly expandable) buffer in memory to hold the data.
120// <li> <linkto class=MMapIO:description>MMapIO</linkto> uses memory-mapped IO.
121// Be careful to use this on 32-bit machines, because its address space is
122// too small to handle a file of a few GBytes.
123// <li> <linkto class=MFFileIO:description>MFFileIO</linkto> uses a virtual
124// file in a <linkto class=MultiFileBase:description>MultiFileBase</linkto>
125// container file. The derived classes MultiFile and MultiHDF5 combine
126// multiple files in a single physical file to reduce the number of
127// files used by CTDS (the Casacore table data system).
128// </ol>
129//
130// The IO framework is easily expandable. One can for instance think of a
131// class <src>AsciiIO</src> derived from <src>TypeIO</src>
132// to hold data in ASCII format.
133// A class <src>RemoteTapeIO</src> could be developed for IO on a tape
134// device on another node.
135// </synopsis>
136
137// </module>
138
139
140
141} //# NAMESPACE CASACORE - END
142
143#endif
144
this file contains all the compiler specific defines
Definition mainpage.dox:28