HDF5 C++ API  1.8.12
 All Classes Namespaces Files Functions Variables Typedefs Macros Pages
H5PredType.h
Go to the documentation of this file.
1 // C++ informative line for the emacs editor: -*- C++ -*-
2 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
3  * Copyright by The HDF Group. *
4  * Copyright by the Board of Trustees of the University of Illinois. *
5  * All rights reserved. *
6  * *
7  * This file is part of HDF5. The full HDF5 copyright notice, including *
8  * terms governing use, modification, and redistribution, is contained in *
9  * the files COPYING and Copyright.html. COPYING can be found at the root *
10  * of the source code distribution tree; Copyright.html can be found at the *
11  * root level of an installed copy of the electronic HDF5 document set and *
12  * is linked from the top-level documents page. It can also be found at *
13  * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
14  * access to either file, you may request a copy from help@hdfgroup.org. *
15  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
16 
17 #ifndef __H5PredType_H
18 #define __H5PredType_H
19 
20 #ifndef H5_NO_NAMESPACE
21 namespace H5 {
22 #endif
23 
24 /* This constant is defined for a workaround to eliminate memory leaks due to
25  the library being re-initiated when PredType destructors are invoked. A
26  PredType instant with H5CPP_EXITED as the value of its "id" is constructed
27  before the other PredType objects are created. At exit, when this special
28  PredType object is to be destructed, no HDF5 library function will be called
29  and the library will be terminated. -BMR, Mar 30, 2012 */
30 #ifndef DOXYGEN_SHOULD_SKIP_THIS
31 #define H5CPP_EXITED -3 // -3 is less likely to be used elsewhere
32 #endif // DOXYGEN_SHOULD_SKIP_THIS
33 
41 class H5_DLLCPP PredType : public AtomType {
42  public:
44  virtual H5std_string fromClass () const { return("PredType"); }
45 
46  // Makes a copy of the predefined type and stores the new
47  // id in the left hand side object.
48  PredType& operator=( const PredType& rhs );
49 
50  // Copy constructor - makes copy of the original object
51  PredType( const PredType& original );
52 
53  // Noop destructor
54  virtual ~PredType();
55 
56  // Declaration of predefined types; their definition is in H5PredType.cpp
57  static const PredType STD_I8BE;
58  static const PredType STD_I8LE;
59  static const PredType STD_I16BE;
60  static const PredType STD_I16LE;
61  static const PredType STD_I32BE;
62  static const PredType STD_I32LE;
63  static const PredType STD_I64BE;
64  static const PredType STD_I64LE;
65  static const PredType STD_U8BE;
66  static const PredType STD_U8LE;
67  static const PredType STD_U16BE;
68  static const PredType STD_U16LE;
69  static const PredType STD_U32BE;
70  static const PredType STD_U32LE;
71  static const PredType STD_U64BE;
72  static const PredType STD_U64LE;
73  static const PredType STD_B8BE;
74  static const PredType STD_B8LE;
75  static const PredType STD_B16BE;
76  static const PredType STD_B16LE;
77  static const PredType STD_B32BE;
78  static const PredType STD_B32LE;
79  static const PredType STD_B64BE;
80  static const PredType STD_B64LE;
81  static const PredType STD_REF_OBJ;
82  static const PredType STD_REF_DSETREG;
83 
84  static const PredType C_S1;
85  static const PredType FORTRAN_S1;
86 
87  static const PredType IEEE_F32BE;
88  static const PredType IEEE_F32LE;
89  static const PredType IEEE_F64BE;
90  static const PredType IEEE_F64LE;
91 
92  static const PredType UNIX_D32BE;
93  static const PredType UNIX_D32LE;
94  static const PredType UNIX_D64BE;
95  static const PredType UNIX_D64LE;
96 
97  static const PredType INTEL_I8;
98  static const PredType INTEL_I16;
99  static const PredType INTEL_I32;
100  static const PredType INTEL_I64;
101  static const PredType INTEL_U8;
102  static const PredType INTEL_U16;
103  static const PredType INTEL_U32;
104  static const PredType INTEL_U64;
105  static const PredType INTEL_B8;
106  static const PredType INTEL_B16;
107  static const PredType INTEL_B32;
108  static const PredType INTEL_B64;
109  static const PredType INTEL_F32;
110  static const PredType INTEL_F64;
111 
112  static const PredType ALPHA_I8;
113  static const PredType ALPHA_I16;
114  static const PredType ALPHA_I32;
115  static const PredType ALPHA_I64;
116  static const PredType ALPHA_U8;
117  static const PredType ALPHA_U16;
118  static const PredType ALPHA_U32;
119  static const PredType ALPHA_U64;
120  static const PredType ALPHA_B8;
121  static const PredType ALPHA_B16;
122  static const PredType ALPHA_B32;
123  static const PredType ALPHA_B64;
124  static const PredType ALPHA_F32;
125  static const PredType ALPHA_F64;
126 
127  static const PredType MIPS_I8;
128  static const PredType MIPS_I16;
129  static const PredType MIPS_I32;
130  static const PredType MIPS_I64;
131  static const PredType MIPS_U8;
132  static const PredType MIPS_U16;
133  static const PredType MIPS_U32;
134  static const PredType MIPS_U64;
135  static const PredType MIPS_B8;
136  static const PredType MIPS_B16;
137  static const PredType MIPS_B32;
138  static const PredType MIPS_B64;
139  static const PredType MIPS_F32;
140  static const PredType MIPS_F64;
141 
142  static const PredType NATIVE_CHAR;
143  static const PredType NATIVE_SCHAR;
144  static const PredType NATIVE_UCHAR;
145  static const PredType NATIVE_SHORT;
146  static const PredType NATIVE_USHORT;
147  static const PredType NATIVE_INT;
148  static const PredType NATIVE_UINT;
149  static const PredType NATIVE_LONG;
150  static const PredType NATIVE_ULONG;
151  static const PredType NATIVE_LLONG;
152  static const PredType NATIVE_ULLONG;
153  static const PredType NATIVE_FLOAT;
154  static const PredType NATIVE_DOUBLE;
155  static const PredType NATIVE_LDOUBLE;
156  static const PredType NATIVE_B8;
157  static const PredType NATIVE_B16;
158  static const PredType NATIVE_B32;
159  static const PredType NATIVE_B64;
160  static const PredType NATIVE_OPAQUE;
161  static const PredType NATIVE_HSIZE;
162  static const PredType NATIVE_HSSIZE;
163  static const PredType NATIVE_HERR;
164  static const PredType NATIVE_HBOOL;
165 
166  static const PredType NATIVE_INT8;
167  static const PredType NATIVE_UINT8;
168  static const PredType NATIVE_INT16;
169  static const PredType NATIVE_UINT16;
170  static const PredType NATIVE_INT32;
171  static const PredType NATIVE_UINT32;
172  static const PredType NATIVE_INT64;
173  static const PredType NATIVE_UINT64;
174 
175 // LEAST types
176 #if H5_SIZEOF_INT_LEAST8_T != 0
177  static const PredType NATIVE_INT_LEAST8;
178 #endif /* H5_SIZEOF_INT_LEAST8_T */
179 #if H5_SIZEOF_UINT_LEAST8_T != 0
180  static const PredType NATIVE_UINT_LEAST8;
181 #endif /* H5_SIZEOF_UINT_LEAST8_T */
182 
183 #if H5_SIZEOF_INT_LEAST16_T != 0
184  static const PredType NATIVE_INT_LEAST16;
185 #endif /* H5_SIZEOF_INT_LEAST16_T */
186 #if H5_SIZEOF_UINT_LEAST16_T != 0
187  static const PredType NATIVE_UINT_LEAST16;
188 #endif /* H5_SIZEOF_UINT_LEAST16_T */
189 
190 #if H5_SIZEOF_INT_LEAST32_T != 0
191  static const PredType NATIVE_INT_LEAST32;
192 #endif /* H5_SIZEOF_INT_LEAST32_T */
193 #if H5_SIZEOF_UINT_LEAST32_T != 0
194  static const PredType NATIVE_UINT_LEAST32;
195 #endif /* H5_SIZEOF_UINT_LEAST32_T */
196 
197 #if H5_SIZEOF_INT_LEAST64_T != 0
198  static const PredType NATIVE_INT_LEAST64;
199 #endif /* H5_SIZEOF_INT_LEAST64_T */
200 #if H5_SIZEOF_UINT_LEAST64_T != 0
201  static const PredType NATIVE_UINT_LEAST64;
202 #endif /* H5_SIZEOF_UINT_LEAST64_T */
203 
204 // FAST types
205 #if H5_SIZEOF_INT_FAST8_T != 0
206  static const PredType NATIVE_INT_FAST8;
207 #endif /* H5_SIZEOF_INT_FAST8_T */
208 #if H5_SIZEOF_UINT_FAST8_T != 0
209  static const PredType NATIVE_UINT_FAST8;
210 #endif /* H5_SIZEOF_UINT_FAST8_T */
211 
212 #if H5_SIZEOF_INT_FAST16_T != 0
213  static const PredType NATIVE_INT_FAST16;
214 #endif /* H5_SIZEOF_INT_FAST16_T */
215 #if H5_SIZEOF_UINT_FAST16_T != 0
216  static const PredType NATIVE_UINT_FAST16;
217 #endif /* H5_SIZEOF_UINT_FAST16_T */
218 
219 #if H5_SIZEOF_INT_FAST32_T != 0
220  static const PredType NATIVE_INT_FAST32;
221 #endif /* H5_SIZEOF_INT_FAST32_T */
222 #if H5_SIZEOF_UINT_FAST32_T != 0
223  static const PredType NATIVE_UINT_FAST32;
224 #endif /* H5_SIZEOF_UINT_FAST32_T */
225 
226 #if H5_SIZEOF_INT_FAST64_T != 0
227  static const PredType NATIVE_INT_FAST64;
228 #endif /* H5_SIZEOF_INT_FAST64_T */
229 #if H5_SIZEOF_UINT_FAST64_T != 0
230  static const PredType NATIVE_UINT_FAST64;
231 #endif /* H5_SIZEOF_UINT_FAST64_T */
232 
236  void commit(H5Location& loc, const H5std_string& name );
240  void commit(H5Location& loc, const char* name );
244  bool committed();
245 
246 #ifndef DOXYGEN_SHOULD_SKIP_THIS
247  private:
248  // Added this to work around the atexit/global destructor problem.
249  // It'll help to terminate the library after other PredType instances
250  // are closed. -BMR, Mar 30, 2012
251  static const PredType AtExit;
252 
253  protected:
254  // Default constructor
255  PredType();
256 
257  // Creates a pre-defined type using an HDF5 pre-defined constant
258  PredType( const hid_t predtype_id ); // used by the library only
259 
260 #endif // DOXYGEN_SHOULD_SKIP_THIS
261 
262 };
263 #ifndef H5_NO_NAMESPACE
264 }
265 #endif
266 #endif // __H5PredType_H
static const PredType ALPHA_U16
Definition: H5PredType.h:117
static const PredType INTEL_B8
Definition: H5PredType.h:105
static const PredType ALPHA_F32
Definition: H5PredType.h:124
static const PredType STD_B8BE
Definition: H5PredType.h:73
static const PredType STD_U16BE
Definition: H5PredType.h:67
static const PredType INTEL_B32
Definition: H5PredType.h:107
static const PredType MIPS_B8
Definition: H5PredType.h:135
static const PredType MIPS_U64
Definition: H5PredType.h:134
static const PredType STD_U32LE
Definition: H5PredType.h:70
static const PredType MIPS_U16
Definition: H5PredType.h:132
static const PredType INTEL_U64
Definition: H5PredType.h:104
static const PredType STD_I8LE
Definition: H5PredType.h:58
static const PredType NATIVE_ULONG
Definition: H5PredType.h:150
static const PredType UNIX_D32BE
Definition: H5PredType.h:92
H5Location is an abstract base class, added in version 1.8.12.
Definition: H5Location.h:49
static const PredType NATIVE_INT16
Definition: H5PredType.h:168
static const PredType NATIVE_UINT16
Definition: H5PredType.h:169
static const PredType UNIX_D64LE
Definition: H5PredType.h:95
static const PredType NATIVE_LLONG
Definition: H5PredType.h:151
static const PredType STD_B64BE
Definition: H5PredType.h:79
static const PredType INTEL_U8
Definition: H5PredType.h:101
static const PredType ALPHA_B32
Definition: H5PredType.h:122
static const PredType STD_B8LE
Definition: H5PredType.h:74
static const PredType STD_U8BE
Definition: H5PredType.h:65
static const PredType NATIVE_OPAQUE
Definition: H5PredType.h:160
static const PredType STD_I64LE
Definition: H5PredType.h:64
static const PredType C_S1
Definition: H5PredType.h:84
static const PredType FORTRAN_S1
Definition: H5PredType.h:85
static const PredType STD_B64LE
Definition: H5PredType.h:80
static const PredType IEEE_F32BE
Definition: H5PredType.h:87
static const PredType NATIVE_B32
Definition: H5PredType.h:158
static const PredType NATIVE_CHAR
Definition: H5PredType.h:142
static const PredType INTEL_I8
Definition: H5PredType.h:97
static const PredType NATIVE_UCHAR
Definition: H5PredType.h:144
static const PredType NATIVE_UINT64
Definition: H5PredType.h:173
static const PredType ALPHA_I64
Definition: H5PredType.h:115
static const PredType NATIVE_HSIZE
Definition: H5PredType.h:161
static const PredType UNIX_D32LE
Definition: H5PredType.h:93
static const PredType STD_B32LE
Definition: H5PredType.h:78
static const PredType STD_U16LE
Definition: H5PredType.h:68
static const PredType ALPHA_F64
Definition: H5PredType.h:125
static const PredType ALPHA_I8
Definition: H5PredType.h:112
static const PredType MIPS_U32
Definition: H5PredType.h:133
static const PredType NATIVE_LONG
Definition: H5PredType.h:149
static const PredType INTEL_I64
Definition: H5PredType.h:100
static const PredType ALPHA_B8
Definition: H5PredType.h:120
static const PredType INTEL_I16
Definition: H5PredType.h:98
static const PredType STD_I32LE
Definition: H5PredType.h:62
static const PredType STD_I16LE
Definition: H5PredType.h:60
static const PredType NATIVE_HBOOL
Definition: H5PredType.h:164
static const PredType NATIVE_B64
Definition: H5PredType.h:159
static const PredType STD_I8BE
Definition: H5PredType.h:57
Class PredType holds the definition of all the HDF5 predefined datatypes.
Definition: H5PredType.h:41
static const PredType IEEE_F64LE
Definition: H5PredType.h:90
static const PredType NATIVE_UINT32
Definition: H5PredType.h:171
static const PredType INTEL_B16
Definition: H5PredType.h:106
static const PredType MIPS_I64
Definition: H5PredType.h:130
static const PredType STD_B16BE
Definition: H5PredType.h:75
static const PredType ALPHA_U64
Definition: H5PredType.h:119
static const PredType ALPHA_U8
Definition: H5PredType.h:116
static const PredType NATIVE_INT8
Definition: H5PredType.h:166
static const PredType STD_B16LE
Definition: H5PredType.h:76
static const PredType UNIX_D64BE
Definition: H5PredType.h:94
static const PredType INTEL_U16
Definition: H5PredType.h:102
static const PredType NATIVE_INT
Definition: H5PredType.h:147
static const PredType NATIVE_ULLONG
Definition: H5PredType.h:152
static const PredType INTEL_U32
Definition: H5PredType.h:103
static const PredType STD_I16BE
Definition: H5PredType.h:59
static const PredType NATIVE_B8
Definition: H5PredType.h:156
static const PredType STD_I32BE
Definition: H5PredType.h:61
static const PredType NATIVE_LDOUBLE
Definition: H5PredType.h:155
static const PredType MIPS_F64
Definition: H5PredType.h:140
static const PredType MIPS_B64
Definition: H5PredType.h:138
static const PredType NATIVE_B16
Definition: H5PredType.h:157
virtual H5std_string fromClass() const
Returns this class name.
Definition: H5PredType.h:44
static const PredType INTEL_F64
Definition: H5PredType.h:110
#define H5std_string
Definition: H5Exception.h:29
static const PredType ALPHA_U32
Definition: H5PredType.h:118
static const PredType NATIVE_DOUBLE
Definition: H5PredType.h:154
static const PredType NATIVE_SCHAR
Definition: H5PredType.h:143
static const PredType INTEL_B64
Definition: H5PredType.h:108
static const PredType NATIVE_FLOAT
Definition: H5PredType.h:153
static const PredType ALPHA_I16
Definition: H5PredType.h:113
static const PredType MIPS_I32
Definition: H5PredType.h:129
static const PredType STD_I64BE
Definition: H5PredType.h:63
static const PredType NATIVE_SHORT
Definition: H5PredType.h:145
static const PredType ALPHA_I32
Definition: H5PredType.h:114
static const PredType MIPS_I16
Definition: H5PredType.h:128
static const PredType STD_B32BE
Definition: H5PredType.h:77
static const PredType STD_U64BE
Definition: H5PredType.h:71
static const PredType ALPHA_B64
Definition: H5PredType.h:123
static const PredType STD_REF_DSETREG
Definition: H5PredType.h:82
static const PredType IEEE_F32LE
Definition: H5PredType.h:88
static const PredType NATIVE_USHORT
Definition: H5PredType.h:146
static const PredType STD_U32BE
Definition: H5PredType.h:69
static const PredType MIPS_F32
Definition: H5PredType.h:139
static const PredType INTEL_I32
Definition: H5PredType.h:99
static const PredType MIPS_B32
Definition: H5PredType.h:137
static const PredType NATIVE_INT64
Definition: H5PredType.h:172
static const PredType MIPS_U8
Definition: H5PredType.h:131
static const PredType ALPHA_B16
Definition: H5PredType.h:121
static const PredType NATIVE_INT32
Definition: H5PredType.h:170
static const PredType STD_REF_OBJ
Definition: H5PredType.h:81
static const PredType NATIVE_UINT8
Definition: H5PredType.h:167
static const PredType MIPS_B16
Definition: H5PredType.h:136
static const PredType STD_U8LE
Definition: H5PredType.h:66
static const PredType IEEE_F64BE
Definition: H5PredType.h:89
static const PredType NATIVE_UINT
Definition: H5PredType.h:148
static const PredType INTEL_F32
Definition: H5PredType.h:109
static const PredType NATIVE_HERR
Definition: H5PredType.h:163
static const PredType NATIVE_HSSIZE
Definition: H5PredType.h:162
static const PredType MIPS_I8
Definition: H5PredType.h:127
Class AtomType is a base class, inherited by IntType, FloatType, StrType, and PredType.
Definition: H5AtomType.h:31
static const PredType STD_U64LE
Definition: H5PredType.h:72