casacore
Loading...
Searching...
No Matches
HDF5HidMeta.h
Go to the documentation of this file.
1//# HDF5HidMeta.h: Classes representing an HDF5 hid of meta objects
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_HDF5HIDMETA_H
27#define CASA_HDF5HIDMETA_H
28
29//# Includes
30#include <casacore/casa/aips.h>
31#include <casacore/casa/HDF5/HDF5Object.h>
32
33namespace casacore { //# NAMESPACE CASACORE - BEGIN
34
35 // <summary>
36 // A class representing an HDF5 property hid.
37 // </summary>
38 // <use visibility=local>
39 // <reviewed reviewer="" date="" tests="tHDF5Dataset.cc">
40 // </reviewed>
41 // <synopsis>
42 // This class wraps an HDF5 property hid (hdf5 id). It offers two benefits:
43 // <ul>
44 // <li> The most important is resource management. In case of an exception,
45 // the hid will automatically be closed by the destructor.
46 // <li> A hid is a kind of pointer and should not be copied. These classes
47 // forbid making a copy, but make it possible to use them in a
48 // shared pointer context.
49 // </ul>
50 // </synopsis>
52 {
53 public:
54 // Default constructor sets hid to invalid.
56 : itsHid(-1) {}
57 // Construct from given hid.
58 HDF5HidProperty (hid_t hid)
59 : itsHid(hid) {}
60 // The destructor closes the hid.
63 // Copy constructor cannot be used.
65 // Assignment cannot be used.
67 // Close the hid if valid.
68 void close();
69 // Put hid in it. If it already contains a hid, it will be closed.
70 void operator= (hid_t hid)
71 { close(); itsHid = hid; }
72 // Get the hid.
73 hid_t getHid() const
74 { return itsHid; }
75 // Convert automatically to hid_t.
76 operator hid_t() const
77 { return itsHid; }
78 private:
79 hid_t itsHid;
80 };
81
82
83 // <summary>
84 // A class representing an HDF5 datatype hid.
85 // </summary>
86 // <use visibility=local>
87 // <reviewed reviewer="" date="" tests="tHDF5Dataset.cc">
88 // </reviewed>
89 // <synopsis>
90 // This class wraps an HDF5 datatype hid (hdf5 id). It offers two benefits:
91 // <ul>
92 // <li> The most important is resource management. In case of an exception,
93 // the hid will automatically be closed by the destructor.
94 // <li> A hid is a kind of pointer and should not be copied. These classes
95 // forbid making a copy, but make it possible to use them in a
96 // shared pointer context.
97 // </ul>
98 // </synopsis>
100 {
101 public:
102 // Default constructor sets hid to invalid.
104 : itsHid(-1) {}
105 // Construct from given hid.
106 HDF5HidDataType (hid_t hid)
107 : itsHid(hid) {}
108 // Copy constructor makes a deep copy.
110 // The destructor closes the hid.
113 // Assignment makes a deep copy.
115 // Close the hid if valid.
116 void close();
117 // Put hid in it. If it already contains a hid, it will be closed.
118 void operator= (hid_t hid)
119 { close(); itsHid = hid; }
120 // Get the hid.
121 hid_t getHid() const
122 { return itsHid; }
123 // Convert automatically to hid_t.
124 operator hid_t() const
125 { return itsHid; }
126 private:
127 hid_t itsHid;
128 };
129
130
131 // <summary>
132 // A class representing an HDF5 dataspace hid.
133 // </summary>
134 // <use visibility=local>
135 // <reviewed reviewer="" date="" tests="tHDF5Dataset.cc">
136 // </reviewed>
137 // <synopsis>
138 // This class wraps an HDF5 dataspace hid (hdf5 id). It offers two benefits:
139 // <ul>
140 // <li> The most important is resource management. In case of an exception,
141 // the hid will automatically be closed by the destructor.
142 // <li> A hid is a kind of pointer and should not be copied. These classes
143 // forbid making a copy, but make it possible to use them in a
144 // shared pointer context.
145 // </ul>
146 // </synopsis>
148 {
149 public:
150 // Default constructor sets hid to invalid.
152 : itsHid(-1) {}
153 // Construct from given hid.
155 : itsHid(hid) {}
156 // The destructor closes the hid.
159 // Copy constructor cannot be used.
161 // Assignment cannot be used.
163 // Close the hid if valid.
164 void close();
165 // Put hid in it. If it already contains a hid, it will be closed.
166 void operator= (hid_t hid)
167 { close(); itsHid = hid; }
168 // Get the hid.
169 hid_t getHid() const
170 { return itsHid; }
171 // Convert automatically to hid_t.
172 operator hid_t() const
173 { return itsHid; }
174 private:
175 hid_t itsHid;
176 };
177
178
179 // <summary>
180 // A class representing an HDF5 attribute hid.
181 // </summary>
182 // <use visibility=local>
183 // <reviewed reviewer="" date="" tests="tHDF5Dataset.cc">
184 // </reviewed>
185 // <synopsis>
186 // This class wraps an HDF5 attribute hid (hdf5 id). It offers two benefits:
187 // <ul>
188 // <li> The most important is resource management. In case of an exception,
189 // the hid will automatically be closed by the destructor.
190 // <li> A hid is a kind of pointer and should not be copied. These classes
191 // forbid making a copy, but make it possible to use them in a
192 // shared pointer context.
193 // </ul>
194 // </synopsis>
196 {
197 public:
198 // Default constructor sets hid to invalid.
200 : itsHid(-1) {}
201 // Construct from given hid.
203 : itsHid(hid) {}
204 // The destructor closes the hid.
207 // Copy constructor cannot be used.
209 // Assignment cannot be used.
211 // Close the hid if valid.
212 void close();
213 // Put hid in it. If it already contains a hid, it will be closed.
214 void operator= (hid_t hid)
215 { close(); itsHid = hid; }
216 // Get the hid.
217 hid_t getHid() const
218 { return itsHid; }
219 // Convert automatically to hid_t.
220 operator hid_t() const
221 { return itsHid; }
222 private:
223 hid_t itsHid;
224 };
225
226
227}
228
229#endif
A class representing an HDF5 attribute hid.
void close()
Close the hid if valid.
hid_t getHid() const
Get the hid.
HDF5HidAttribute & operator=(const HDF5HidAttribute &)=delete
Assignment cannot be used.
HDF5HidAttribute()
Default constructor sets hid to invalid.
HDF5HidAttribute(hid_t hid)
Construct from given hid.
~HDF5HidAttribute()
The destructor closes the hid.
HDF5HidAttribute(const HDF5HidAttribute &)=delete
Copy constructor cannot be used.
A class representing an HDF5 dataspace hid.
~HDF5HidDataSpace()
The destructor closes the hid.
HDF5HidDataSpace(hid_t hid)
Construct from given hid.
HDF5HidDataSpace(const HDF5HidDataSpace &)=delete
Copy constructor cannot be used.
hid_t getHid() const
Get the hid.
HDF5HidDataSpace()
Default constructor sets hid to invalid.
HDF5HidDataSpace & operator=(const HDF5HidDataSpace &)=delete
Assignment cannot be used.
void close()
Close the hid if valid.
A class representing an HDF5 datatype hid.
HDF5HidDataType & operator=(const HDF5HidDataType &that)
Assignment makes a deep copy.
~HDF5HidDataType()
The destructor closes the hid.
hid_t getHid() const
Get the hid.
void close()
Close the hid if valid.
HDF5HidDataType()
Default constructor sets hid to invalid.
HDF5HidDataType(hid_t hid)
Construct from given hid.
HDF5HidDataType(const HDF5HidDataType &that)
Copy constructor makes a deep copy.
HDF5HidProperty()
Default constructor sets hid to invalid.
Definition HDF5HidMeta.h:55
HDF5HidProperty & operator=(const HDF5HidProperty &)=delete
Assignment cannot be used.
HDF5HidProperty(const HDF5HidProperty &)=delete
Copy constructor cannot be used.
void close()
Close the hid if valid.
~HDF5HidProperty()
The destructor closes the hid.
Definition HDF5HidMeta.h:61
hid_t getHid() const
Get the hid.
Definition HDF5HidMeta.h:73
HDF5HidProperty(hid_t hid)
Construct from given hid.
Definition HDF5HidMeta.h:58
this file contains all the compiler specific defines
Definition mainpage.dox:28