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