casacore
Loading...
Searching...
No Matches
HDF5.h
Go to the documentation of this file.
1//# HDF5.h: Classes binding casacore to the HDF5 C API
2//# Copyright (C) 2008
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_HDF5_H
27#define CASA_HDF5_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31
32#include <casacore/casa/HDF5/HDF5File.h>
33#include <casacore/casa/HDF5/HDF5Group.h>
34#include <casacore/casa/HDF5/HDF5DataSet.h>
35#include <casacore/casa/HDF5/HDF5Record.h>
36#include <casacore/casa/HDF5/HDF5Error.h>
37
38
39namespace casacore { //# NAMESPACE CASACORE - BEGIN
40
41// <module>
42//
43// <summary>
44// Classes binding casacore to the HDF5 C API
45// </summary>
46
47// <prerequisite>
48// <li> HDF5 (see http://www.hdfgroup.uiuc.edu/HDF5/doc_dev_snapshot)
49// </prerequisite>
50
51// <reviewed reviewer="" date="" demos="">
52// </reviewed>
53
54// <etymology>
55// 'HDF5' is version 5 of the Hierarchical Data Format.
56// </etymology>
57//
58// <synopsis>
59// This module's main purpose is to provide limited, but convenient
60// access to the HDF5 C API.
61// The classes offer the following services:
62// <ul>
63// <li> The burden of allocating and releasing the HDF5 resources
64// (the so-called hid-s) is handled in an automatic and
65// exception-safe way.
66// <li> The overwhelming and rather hard to use HDF5 C API is hidden.
67// <li> The standard casacore data types (scalars and arrays) are supported.
68// Because HDF5 does not support empty strings, they are transparantly
69// replaced by the value '__empty__'.
70// Also HDF5 does not support empty arrays, thus they are stored
71// in a special way using a special compound value.
72// <li> A Record is stored as a group. Its values (scalars and arrays)
73// are stored as attributes, while nested records are stored as
74// nested groups.
75// <li> Bool values are stored as chars.
76// <li> Complex values are stored as compounds of two real values.
77// <li> Large arrays can be stored in HDF5 DataSets with an optional tile size
78// (chunk size in HDF5 terminology). The array axes are reversed (fully
79// transparantly) because HDF5 uses C-order, while casacore Arrays use
80// Fortran-order.
81// <li> Automatic printing of HDF5 messages is disabled. All errors are
82// thrown as exceptions (AipsError or derived from it).
83// </ul>
84//
85// The following interface classes are available:
86// <ul>
87// <li> HDF5File opens or creates an HDF5 file and closes it automatically.
88// Furthermore it has a function to test if a file is in HDF5 format.
89// <li> HDF5DataType defines the HDF5 memory and file data type. It supports
90// the basic data types, complex, string, arrays and compounds.
91// <li> HDF5Record reads or writes a Record as a group in an HDF5 object.
92// <li> HDF5DataSet opens or creates a possible tiled data set in an HDF5
93// object. The array can be read or written in parts.
94// It can be created of any HDF5DataType.
95// <li> HDF5Group opens, creates, or removes a group in an HDF5 object.
96// </ul>
97// Note that HDF5Object forms the base class of HDF5File, HDF5Group, and
98// HDF5DataSet. Most interfaces use HDF5Object, thus are applicable to
99// all these object types.
100// <br>An HDF5Object has a conversion operator to <src>hid_t</src>, thus
101// can be used directly in any HDF5 function.
102//
103// Because of HDF5 resource management the objects (e.g. HDF5File) cannot be
104// copied. However, they can be used in shared pointers such as std::shared_ptr.
105// <br>
106// Internally the classes use HDF5HidMeta.h which does the resource management
107// for HDF5 meta data like attributes, property lists, etc..
108//
109// <note>
110// All HDF5 classes and all their functions are compiled, but it depends on
111// the setting of HAVE_HDF5 how. If not set, all these functions are merely
112// stubs and the class constructors throw an exception when used.
113// The function <src>HDF5Object::hasHDF5Support()</src> tells if HDF5 is used.
114// See the casacore build instructions at github.com/casacore/casacore
115// for more information.
116// </note>
117// </synopsis>
118
119// <example>
120// See the various test programs.
121// </example>
122//
123// <motivation>
124// HDF5 offers a C++ interface. However, this interface is still quite complex
125// and is too much C-oriented.
126// Furthermore there was the need to support the casacore data types,
127// in particular complex. The reversal of array axes was also needed.
128// </motivation>
129
130// <todo asof="2008/03/13">
131// <li> Set the optimal data set chunk cache size from a given access pattern.
132// The current problem is that setting the cache size requires that
133// the file is closed first.
134// For the time being a fixed cache size of 16 MB is used instead of
135// the default 1 MB.
136// </todo>
137
138// </module>
139
140
141} //# NAMESPACE CASACORE - END
142
143#endif
this file contains all the compiler specific defines
Definition mainpage.dox:28