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
47namespace casacore { // # NAMESPACE CASACORE - BEGIN
48
49// <module>
50
51// <summary>
52// Basic classes and global functions for IO and object persistency
53// </summary>
54
55// <reviewed reviewer="UNKNOWN" date="before2004/08/25" demos="">
56// </reviewed>
57
58// <synopsis>
59// This module provides the basic IO functionality for the Casacore classes.
60// There are two IO mechanisms:
61// <ol>
62// <li> Class <linkto class=AipsIO:description>AipsIO</linkto>
63// provides the object persistency mechanism.
64// The templated global functions in
65// <linkto file="AipsIOCarray.h#AipsIOCarray">AipsIOCarray.h</linkto>
66// form a little layer upon AipsIO. They provide the means to put or
67// get a C-style array of any type.
68// <li> Class <linkto class=ByteSinkSource:description>ByteSinkSource</linkto>
69// and its ancestors provide a general IO mechanism.
70// </ol>
71//
72// Both use the underlying IO framework which define where and how
73// the data are written. The how-part is defined by classes derived from
74// <linkto class=TypeIO:description>TypeIO</linkto> as shown
75// in the <a href=IO-framework.drawio.svg.html>UML diagram</a>.
76// There are three such classes:
77// <ol>
78// <li> <linkto class=CanonicalIO:description>CanonicalIO</linkto> reads/writes
79// data in canonical (machine-independent) format. This should be
80// used when data are meant to be exportable.
81// It uses the conversion functions in class
82// <linkto class=CanonicalConversion:description>CanonicalConversion
83// </linkto>.
84// <li> <linkto class=RawIO:description>RawIO</linkto> reads/writes
85// data in native (machine-dependent) format. This can be used when
86// data are not exported.
87// <li> <linkto class=ConversionIO:description>ConversionIO</linkto>
88// reads/writes in an external format as defined at construction time.
89// This can be used when the external format can be one of several
90// (e.g. VAX or IBM for a WSRT archive tape). In this way the
91// format has to be defined only once and thereafter is it handled
92// correctly by the polymorphism mechanism.
93// </ol>
94// The where-part is defined by classes derived from
95// <linkto class=ByteIO:description>ByteIO</linkto> as shown
96// in the <a href=IO-framework.drawio.svg.html>UML diagram</a>.
97// There are a few such classes:
98// <ol>
99// <li> <linkto class=RegularFileIO:description>RegularFileIO</linkto> uses a
100// regular file to hold the data. Internally it uses FilebufIO (see below).
101// It can handle files > 2 GB.
102// <li> <linkto class=FilebufIO:description>FilebufIO</linkto> does the IO
103// in a buffered way similar to the <src>stdio</src> system. However, it
104// does not use stdio because that gave problems when doing concurrent
105// access from multiple processes.
106// It can handle files > 2 GB.
107// <li> <linkto class=FiledesIO:description>FiledesIO</linkto> uses the
108// UNIX IO-functions like <src>open, read</src> to do IO directly.
109// It does not use an internal buffer. Instead it always does
110// physical IO. It is meant for IO operations where large chunks of
111// a file are accessed and for IO on sockets, pipes, etc..
112// It can handle files > 2 GB.
113// <li> <linkto class=StreamIO:description>StreamIO</linkto> for IO
114// on a socket.
115// <li> <linkto class=TapeIO:description>TapeIO</linkto> for IO on a tape
116// device.
117// <li> <linkto class=MemoryIO:description>MemoryIO</linkto> uses a
118// (possibly expandable) buffer in memory to hold the data.
119// <li> <linkto class=MMapIO:description>MMapIO</linkto> uses memory-mapped IO.
120// Be careful to use this on 32-bit machines, because its address space is
121// too small to handle a file of a few GBytes.
122// <li> <linkto class=MFFileIO:description>MFFileIO</linkto> uses a virtual
123// file in a <linkto class=MultiFileBase:description>MultiFileBase</linkto>
124// container file. The derived classes MultiFile and MultiHDF5 combine
125// multiple files in a single physical file to reduce the number of
126// files used by CTDS (the Casacore table data system).
127// </ol>
128//
129// The IO framework is easily expandable. One can for instance think of a
130// class <src>AsciiIO</src> derived from <src>TypeIO</src>
131// to hold data in ASCII format.
132// A class <src>RemoteTapeIO</src> could be developed for IO on a tape
133// device on another node.
134// </synopsis>
135
136// </module>
137
138} // namespace casacore
139
140#endif
For temporary backward namespace compatibility, use casa as alias for casacore.
Definition mainpage.dox:28