1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>HDF5: Identifiers (H5I)</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function() { init_search(); });
/* @license-end */
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="hdf5doxy.css" rel="stylesheet" type="text/css">
<!-- <link href="hdf5doxy.css" rel="stylesheet" type="text/css"/>
-->
<script type="text/javascript" src="hdf5_navtree_hacks.js"></script>
</head>
<body>
<div style="background:#FFDDDD;font-size:120%;text-align:center;margin:0;padding:5px">Please, help us to better serve our user community by answering the following short survey: <a href="https://www.hdfgroup.org/website-survey/">https://www.hdfgroup.org/website-survey/</a></div>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectlogo"><img alt="Logo" src="HDFG-logo.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname"><a href="https://www.hdfgroup.org">HDF5</a>
 <span id="projectnumber">1.15.0.b166368</span>
</div>
<div id="projectbrief">API Reference</div>
</td>
<td> <div id="MSearchBox" class="MSearchBoxInactive">
<span class="left">
<img id="MSearchSelect" src="search/mag_sel.svg"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
alt=""/>
<input type="text" id="MSearchField" value="Search" accesskey="S"
onfocus="searchBox.OnSearchFieldFocus(true)"
onblur="searchBox.OnSearchFieldFocus(false)"
onkeyup="searchBox.OnSearchFieldChange(event)"/>
</span><span class="right">
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('group___h5_i.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div class="header">
<div class="summary">
<a href="#groups">Modules</a> |
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
<div class="title">Identifiers (H5I)</div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>Use the functions in this module to manage identifiers defined by the HDF5 library. See <a class="el" href="group___h5_i_u_d.html">User-defined ID Types</a> for user-defined identifiers and identifier types.</p>
<p>HDF5 identifiers are usually created as a side-effect of creating HDF5 entities such as groups, datasets, attributes, or property lists.</p>
<p>Identifiers defined by the HDF5 library can be used to retrieve information such as path names and reference counts, and their validity can be checked.</p>
<p>Identifiers can be updated by manipulating their reference counts.</p>
<p>Unused identifiers should be reclaimed by closing the associated item, e.g., HDF5 object, or decrementing the reference count to 0.</p>
<dl class="section note"><dt>Note</dt><dd>Identifiers (of type <a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a>) are run-time auxiliaries and not persisted in the file.</dd></dl>
<table class="doxtable">
<tr>
<th>Create</th><th>Read </th></tr>
<tr valign="top">
<td><div class="fragment"><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>  {</div>
<div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  __label__ fail_dcpl;</div>
<div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  <a class="code" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> dcpl;</div>
<div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  </div>
<div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  <span class="comment">// create an ID of a pre-defined ID type</span></div>
<div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  <span class="keywordflow">if</span> ((dcpl = <a class="code" href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a>(<a class="code" href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a>)) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>) {</div>
<div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  ret_val = EXIT_FAILURE;</div>
<div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  <span class="keywordflow">goto</span> fail_dcpl;</div>
<div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  }</div>
<div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  </div>
<div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="comment">// we can reliably predict the ID type</span></div>
<div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  assert(<a class="code" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">H5Iget_type</a>(dcpl) == <a class="code" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832bab6161706783d4bca26a889f1ac0cf91a">H5I_GENPROP_LST</a>);</div>
<div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  printf(<span class="stringliteral">"%d\n"</span>, <a class="code" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">H5Iget_type</a>(dcpl));</div>
<div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  </div>
<div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <a class="code" href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a>(dcpl);</div>
<div class="line"><a name="l00030"></a><span class="lineno"> 30</span> fail_dcpl:;</div>
<div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  }</div>
<div class="ttc" id="a_h5_ipublic_8h_html_a0045db7ff9c22ad35db6ae91662e1943"><div class="ttname"><a href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a></div><div class="ttdeci">int64_t hid_t</div><div class="ttdef"><b>Definition:</b> H5Ipublic.h:60</div></div>
<div class="ttc" id="a_h5_ipublic_8h_html_a01eab13dccc91afd6909d74dccb780ba"><div class="ttname"><a href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a></div><div class="ttdeci">#define H5I_INVALID_HID</div><div class="ttdef"><b>Definition:</b> H5Ipublic.h:75</div></div>
<div class="ttc" id="a_h5_ipublic_8h_html_a13afe14178faf81b89fa2167e7ab832bab6161706783d4bca26a889f1ac0cf91a"><div class="ttname"><a href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832bab6161706783d4bca26a889f1ac0cf91a">H5I_GENPROP_LST</a></div><div class="ttdeci">@ H5I_GENPROP_LST</div><div class="ttdef"><b>Definition:</b> H5Ipublic.h:47</div></div>
<div class="ttc" id="a_h5_ppublic_8h_html_a6f9c8a5aba72c0445fff384bf418a80d"><div class="ttname"><a href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a></div><div class="ttdeci">#define H5P_DATASET_XFER</div><div class="ttdef"><b>Definition:</b> H5Ppublic.h:55</div></div>
<div class="ttc" id="agroup___h5_i_html_ga4941435d4d64de3d7095d2316f415f2d"><div class="ttname"><a href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">H5Iget_type</a></div><div class="ttdeci">H5I_type_t H5Iget_type(hid_t id)</div><div class="ttdoc">Retrieves the type of an object.</div></div>
<div class="ttc" id="agroup___p_l_c_r_html_ga5dce61149211d3ef319452aa598887fb"><div class="ttname"><a href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a></div><div class="ttdeci">herr_t H5Pclose(hid_t plist_id)</div><div class="ttdoc">Terminates access to a property list.</div></div>
<div class="ttc" id="agroup___p_l_c_r_html_gaf1b11da01d4d45d788c45f8bc5f0cbfa"><div class="ttname"><a href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a></div><div class="ttdeci">hid_t H5Pcreate(hid_t cls_id)</div><div class="ttdoc">Creates a new property list as an instance of a property list class.</div></div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  {</div>
<div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  __label__ fail_dcpl;</div>
<div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <a class="code" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> dcpl;</div>
<div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div>
<div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="comment">// create an ID of a pre-defined ID type</span></div>
<div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">if</span> ((dcpl = <a class="code" href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a>(<a class="code" href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a>)) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>) {</div>
<div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  ret_val = EXIT_FAILURE;</div>
<div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordflow">goto</span> fail_dcpl;</div>
<div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  }</div>
<div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  </div>
<div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  <span class="comment">// this better be valid</span></div>
<div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  assert(<a class="code" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">H5Iis_valid</a>(dcpl) > 0);</div>
<div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  </div>
<div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="comment">// this ID is NOT associated with any HDF5 file;</span></div>
<div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="comment">// see the error message</span></div>
<div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  assert(<a class="code" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042">H5Iget_file_id</a>(dcpl) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>);</div>
<div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  </div>
<div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <a class="code" href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a>(dcpl);</div>
<div class="line"><a name="l00053"></a><span class="lineno"> 53</span> fail_dcpl:;</div>
<div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  }</div>
<div class="ttc" id="agroup___h5_i_html_ga20eb10c559d9ed5ba6f77b31d6a3ba9a"><div class="ttname"><a href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">H5Iis_valid</a></div><div class="ttdeci">htri_t H5Iis_valid(hid_t id)</div><div class="ttdoc">Determines whether an identifier is valid.</div></div>
<div class="ttc" id="agroup___h5_i_html_ga6ce32e88051e4cdf7d02439d86e5e042"><div class="ttname"><a href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042">H5Iget_file_id</a></div><div class="ttdeci">hid_t H5Iget_file_id(hid_t id)</div><div class="ttdoc">Retrieves an identifier for the file containing the specified object.</div></div>
</div><!-- fragment --> </td></tr>
<tr>
<th>Update</th><th>Delete </th></tr>
<tr valign="top">
<td><div class="fragment"><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  {</div>
<div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  __label__ fail_rc, fail_dcpl;</div>
<div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <a class="code" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> dcpl;</div>
<div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordtype">int</span> rc;</div>
<div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  </div>
<div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="comment">// create an ID of a pre-defined ID type</span></div>
<div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordflow">if</span> ((dcpl = <a class="code" href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a>(<a class="code" href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a>)) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>) {</div>
<div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  ret_val = EXIT_FAILURE;</div>
<div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordflow">goto</span> fail_dcpl;</div>
<div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  }</div>
<div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  </div>
<div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="comment">// retrieve the IDs reference count</span></div>
<div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">if</span> ((rc = <a class="code" href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81">H5Iget_ref</a>(dcpl)) < 0) {</div>
<div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  ret_val = EXIT_FAILURE;</div>
<div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordflow">goto</span> fail_rc;</div>
<div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  }</div>
<div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  printf(<span class="stringliteral">"Reference count: %d\n"</span>, rc);</div>
<div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  </div>
<div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <span class="comment">// bump its reference count (by 1)</span></div>
<div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keywordflow">if</span> ((rc = <a class="code" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f">H5Iinc_ref</a>(dcpl)) < 0) {</div>
<div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  ret_val = EXIT_FAILURE;</div>
<div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">goto</span> fail_rc;</div>
<div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  }</div>
<div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  printf(<span class="stringliteral">"Reference count: %d\n"</span>, rc);</div>
<div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  </div>
<div class="line"><a name="l00083"></a><span class="lineno"> 83</span> fail_rc:</div>
<div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a>(dcpl);</div>
<div class="line"><a name="l00085"></a><span class="lineno"> 85</span> fail_dcpl:;</div>
<div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  }</div>
<div class="ttc" id="agroup___h5_i_html_ga3fd0c157704573965cafd6e1aa7f368f"><div class="ttname"><a href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f">H5Iinc_ref</a></div><div class="ttdeci">int H5Iinc_ref(hid_t id)</div><div class="ttdoc">Increments the reference count for an object.</div></div>
<div class="ttc" id="agroup___h5_i_html_gac9638ade14cc75b7b125b3723f319c81"><div class="ttname"><a href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81">H5Iget_ref</a></div><div class="ttdeci">int H5Iget_ref(hid_t id)</div><div class="ttdoc">Retrieves the reference count for an object.</div></div>
</div><!-- fragment --> </td><td><div class="fragment"><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  {</div>
<div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  __label__ fail_rc, fail_dcpl;</div>
<div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="code" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> dcpl;</div>
<div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keywordtype">int</span> rc;</div>
<div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  </div>
<div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  <span class="comment">// create an ID of a pre-defined ID type</span></div>
<div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">if</span> ((dcpl = <a class="code" href="group___p_l_c_r.html#gaf1b11da01d4d45d788c45f8bc5f0cbfa">H5Pcreate</a>(<a class="code" href="_h5_ppublic_8h.html#a6f9c8a5aba72c0445fff384bf418a80d">H5P_DATASET_XFER</a>)) == <a class="code" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>) {</div>
<div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  ret_val = EXIT_FAILURE;</div>
<div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keywordflow">goto</span> fail_dcpl;</div>
<div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  }</div>
<div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  </div>
<div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="comment">// decrease its reference count (from 1) to 0</span></div>
<div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">if</span> ((rc = <a class="code" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9">H5Idec_ref</a>(dcpl)) < 0) {</div>
<div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  ret_val = EXIT_FAILURE;</div>
<div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  <span class="keywordflow">goto</span> fail_rc;</div>
<div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  }</div>
<div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  printf(<span class="stringliteral">"Reference count: %d\n"</span>, rc);</div>
<div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  </div>
<div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="comment">// at this point, the ID is no longer valid</span></div>
<div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  assert(<a class="code" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">H5Iis_valid</a>(dcpl) == 0);</div>
<div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  </div>
<div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="comment">// dropping the ref. count to 0 has the side-effect of closing</span></div>
<div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  <span class="comment">// the associated item, and calling H5Pclose would create an error</span></div>
<div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">goto</span> fail_dcpl;</div>
<div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  </div>
<div class="line"><a name="l00115"></a><span class="lineno"> 115</span> fail_rc:</div>
<div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <a class="code" href="group___p_l_c_r.html#ga5dce61149211d3ef319452aa598887fb">H5Pclose</a>(dcpl);</div>
<div class="line"><a name="l00117"></a><span class="lineno"> 117</span> fail_dcpl:;</div>
<div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  }</div>
<div class="ttc" id="agroup___h5_i_html_gaea2aa78caea892edf2a6a6ac70486ed9"><div class="ttname"><a href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9">H5Idec_ref</a></div><div class="ttdeci">int H5Idec_ref(hid_t id)</div><div class="ttdoc">Decrements the reference count for an object.</div></div>
</div><!-- fragment --> </td></tr>
</table>
<div id="dynsection-0" onclick="return toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;">
<img id="dynsection-0-trigger" src="closed.png" alt="+"/> Collaboration diagram for Identifiers (H5I):</div>
<div id="dynsection-0-summary" class="dynsummary" style="display:block;">
</div>
<div id="dynsection-0-content" class="dyncontent" style="display:none;">
<div class="center"><img src="group___h5_i.png" border="0" usemap="#agroup______h5__i" alt=""/></div>
<map name="agroup______h5__i" id="agroup______h5__i">
<area shape="rect" title=" " alt="" coords="5,5,128,31"/>
<area shape="rect" href="group___h5_i_u_d.html" title=" " alt="" coords="176,5,340,31"/>
</map>
</div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a>
Modules</h2></td></tr>
<tr class="memitem:group___h5_i_u_d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i_u_d.html">User-defined ID Types</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2"> </td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gad61703cd16f392fb194da648099e69a9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9">H5Iregister_future</a> (<a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832b">H5I_type_t</a> type, const void *object, <a class="el" href="_h5_idevelop_8h.html#ab0f349ec701c3d8c6ded067f160da44c">H5I_future_realize_func_t</a> realize_cb, <a class="el" href="_h5_idevelop_8h.html#a127fbac3b8283a7804d8470676a65518">H5I_future_discard_func_t</a> discard_cb)</td></tr>
<tr class="memdesc:gad61703cd16f392fb194da648099e69a9"><td class="mdescLeft"> </td><td class="mdescRight">Registers a "future" object under a type and returns an ID for it. <a href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9">More...</a><br /></td></tr>
<tr class="separator:gad61703cd16f392fb194da648099e69a9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga4941435d4d64de3d7095d2316f415f2d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832b">H5I_type_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">H5Iget_type</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr>
<tr class="memdesc:ga4941435d4d64de3d7095d2316f415f2d"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the type of an object. <a href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d">More...</a><br /></td></tr>
<tr class="separator:ga4941435d4d64de3d7095d2316f415f2d"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga6ce32e88051e4cdf7d02439d86e5e042"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042">H5Iget_file_id</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr>
<tr class="memdesc:ga6ce32e88051e4cdf7d02439d86e5e042"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves an identifier for the file containing the specified object. <a href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042">More...</a><br /></td></tr>
<tr class="separator:ga6ce32e88051e4cdf7d02439d86e5e042"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga9c84a8dc29566b82b6d1ff7a6e6828f1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#af629ed855824cf5955b54529adf78ad6">ssize_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1">H5Iget_name</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id, char *name, size_t size)</td></tr>
<tr class="memdesc:ga9c84a8dc29566b82b6d1ff7a6e6828f1"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves a name of an object based on the object identifier. <a href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1">More...</a><br /></td></tr>
<tr class="separator:ga9c84a8dc29566b82b6d1ff7a6e6828f1"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga3fd0c157704573965cafd6e1aa7f368f"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f">H5Iinc_ref</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr>
<tr class="memdesc:ga3fd0c157704573965cafd6e1aa7f368f"><td class="mdescLeft"> </td><td class="mdescRight">Increments the reference count for an object. <a href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f">More...</a><br /></td></tr>
<tr class="separator:ga3fd0c157704573965cafd6e1aa7f368f"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gaea2aa78caea892edf2a6a6ac70486ed9"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9">H5Idec_ref</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr>
<tr class="memdesc:gaea2aa78caea892edf2a6a6ac70486ed9"><td class="mdescLeft"> </td><td class="mdescRight">Decrements the reference count for an object. <a href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9">More...</a><br /></td></tr>
<tr class="separator:gaea2aa78caea892edf2a6a6ac70486ed9"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:gac9638ade14cc75b7b125b3723f319c81"><td class="memItemLeft" align="right" valign="top">int </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81">H5Iget_ref</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr>
<tr class="memdesc:gac9638ade14cc75b7b125b3723f319c81"><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the reference count for an object. <a href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81">More...</a><br /></td></tr>
<tr class="separator:gac9638ade14cc75b7b125b3723f319c81"><td class="memSeparator" colspan="2"> </td></tr>
<tr class="memitem:ga20eb10c559d9ed5ba6f77b31d6a3ba9a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="_h5public_8h.html#aa8f6c28736dbd0f18388c67911d38aca">htri_t</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">H5Iis_valid</a> (<a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> id)</td></tr>
<tr class="memdesc:ga20eb10c559d9ed5ba6f77b31d6a3ba9a"><td class="mdescLeft"> </td><td class="mdescRight">Determines whether an identifier is valid. <a href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">More...</a><br /></td></tr>
<tr class="separator:ga20eb10c559d9ed5ba6f77b31d6a3ba9a"><td class="memSeparator" colspan="2"> </td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gaea2aa78caea892edf2a6a6ac70486ed9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gaea2aa78caea892edf2a6a6ac70486ed9">◆ </a></span>H5Idec_ref()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int H5Idec_ref </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Decrements the reference count for an object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative reference count of the object ID after decrementing it, if successful; otherwise a negative value is returned.</dd></dl>
<p><a class="el" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9" title="Decrements the reference count for an object.">H5Idec_ref()</a> decrements the reference count of the object identified by <code>id</code>.</p>
<p>The reference count for an object ID is attached to the information about an object in memory and has no relation to the number of links to an object on disk.</p>
<p>The reference count for a newly created object will be 1. Reference counts for objects may be explicitly modified with this function or with <a class="el" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f" title="Increments the reference count for an object.">H5Iinc_ref()</a>. When an object identifier's reference count reaches zero, the object will be closed. Calling an object identifier's <code>close</code> function decrements the reference count for the identifier, which normally closes the object, but if the reference count for the identifier has been incremented with <a class="el" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f" title="Increments the reference count for an object.">H5Iinc_ref()</a>, the object will only be closed when the reference count reaches zero with further calls to this function or the object identifier's <code>close</code> function.</p>
<p>If the object ID was created by a collective parallel call (such as <a class="el" href="group___h5_d.html#ga0647ba4bbd26d5230cc07f3a5685b2cf">H5Dcreate()</a>, <a class="el" href="group___h5_g.html#ga3eca6807deff4f9e51fc5fe0befc2245">H5Gopen()</a>, etc.), the reference count should be modified by all the processes which have copies of the ID. Generally, this means that group, dataset, attribute, file and named datatype IDs should be modified by all the processes and that all other types of IDs are safe to modify by individual processes.</p>
<p>This function is of particular value when an application maintains multiple copies of an object ID. The object ID can be incremented when a copy is made. Each copy of the ID can then be safely closed or decremented and the HDF5 object will be closed when the reference count for that object drops to zero.</p>
<dl class="section since"><dt>Since</dt><dd>1.6.2 </dd></dl>
</div>
</div>
<a id="ga6ce32e88051e4cdf7d02439d86e5e042"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga6ce32e88051e4cdf7d02439d86e5e042">◆ </a></span>H5Iget_file_id()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> H5Iget_file_id </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves an identifier for the file containing the specified object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a file identifier if successful; otherwise returns <a class="el" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>.</dd></dl>
<p><a class="el" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042" title="Retrieves an identifier for the file containing the specified object.">H5Iget_file_id()</a> returns the identifier of the file associated with the object referenced by <code>id</code>.</p>
<dl class="section note"><dt>Note</dt><dd>Note that the HDF5 library permits an application to close a file while objects within the file remain open. If the file containing the object <code>id</code> is still open, <a class="el" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042" title="Retrieves an identifier for the file containing the specified object.">H5Iget_file_id()</a> will retrieve the existing file identifier. If there is no existing file identifier for the file, i.e., the file has been closed, <a class="el" href="group___h5_i.html#ga6ce32e88051e4cdf7d02439d86e5e042" title="Retrieves an identifier for the file containing the specified object.">H5Iget_file_id()</a> will reopen the file and return a new file identifier. In either case, the file identifier must eventually be released using <a class="el" href="group___h5_f.html#gac55cd91d80822e4f8c2a7f04ea71b124" title="Terminates access to an HDF5 file.">H5Fclose()</a>.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.6.3 </dd></dl>
</div>
</div>
<a id="ga9c84a8dc29566b82b6d1ff7a6e6828f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga9c84a8dc29566b82b6d1ff7a6e6828f1">◆ </a></span>H5Iget_name()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#af629ed855824cf5955b54529adf78ad6">ssize_t</a> H5Iget_name </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td>
<td class="paramname"><em>id</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">char * </td>
<td class="paramname"><em>name</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t </td>
<td class="paramname"><em>size</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves a name of an object based on the object identifier. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier </td></tr>
<tr><td class="paramdir">[out]</td><td class="paramname">name</td><td>A buffer for the name associated with the identifier </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">size</td><td>The size of the <code>name</code> buffer; usually the size of the name in bytes plus 1 for a NULL terminator</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>ssize_t</dd></dl>
<p><a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> retrieves a name for the object identified by <code>id</code>.</p>
<p>Up to size characters of the name are returned in <code>name</code>; additional characters, if any, are not returned to the user application.</p>
<p>If the length of the name, which determines the required value of <code>size</code>, is unknown, a preliminary <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> call can be made. The return value of this call will be the size in bytes of the object name. That value, plus 1 for a NULL terminator, is then assigned to size for a second <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> call, which will retrieve the actual name.</p>
<p>If the object identified by <code>id</code> is an attribute, as determined via <a class="el" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d" title="Retrieves the type of an object.">H5Iget_type()</a>, <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> retrieves the name of the object to which that attribute is attached. To retrieve the name of the attribute itself, use <a class="el" href="group___h5_a.html#ga05e195aabab8c623b1c52009aeb99674" title="Gets an attribute name.">H5Aget_name()</a>.</p>
<p>If there is no name associated with the object identifier or if the name is NULL, <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> returns 0 (zero).</p>
<dl class="section note"><dt>Note</dt><dd>Note that an object in an HDF5 file may have multiple paths if there are multiple links pointing to it. This function may return any one of these paths. When possible, <a class="el" href="group___h5_i.html#ga9c84a8dc29566b82b6d1ff7a6e6828f1" title="Retrieves a name of an object based on the object identifier.">H5Iget_name()</a> returns the path with which the object was opened.</dd></dl>
<dl class="section since"><dt>Since</dt><dd>1.6.0 </dd></dl>
</div>
</div>
<a id="gac9638ade14cc75b7b125b3723f319c81"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gac9638ade14cc75b7b125b3723f319c81">◆ </a></span>H5Iget_ref()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int H5Iget_ref </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the reference count for an object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative current reference count of the object identifier if successful; otherwise a negative value is returned.</dd></dl>
<p><a class="el" href="group___h5_i.html#gac9638ade14cc75b7b125b3723f319c81" title="Retrieves the reference count for an object.">H5Iget_ref()</a> retrieves the reference count of the object identified by <code>id</code>.</p>
<p>The reference count for an object identifier is attached to the information about an object in memory and has no relation to the number of links to an object on disk.</p>
<p>The function <a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a" title="Determines whether an identifier is valid.">H5Iis_valid()</a> is used to determine whether a specific object identifier is valid.</p>
<dl class="section since"><dt>Since</dt><dd>1.6.2 </dd></dl>
</div>
</div>
<a id="ga4941435d4d64de3d7095d2316f415f2d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga4941435d4d64de3d7095d2316f415f2d">◆ </a></span>H5Iget_type()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832b">H5I_type_t</a> H5Iget_type </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Retrieves the type of an object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns the object type if successful; otherwise <a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832ba3e61c9654de6398dc9676ad37cbe6133">H5I_BADID</a>.</dd></dl>
<p><a class="el" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d" title="Retrieves the type of an object.">H5Iget_type()</a> retrieves the type of the object identified by <code>id</code>. If no valid type can be determined or the identifier submitted is invalid, the function returns <a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832ba3e61c9654de6398dc9676ad37cbe6133">H5I_BADID</a>.</p>
<p>This function is of particular use in determining the type of object closing function (<a class="el" href="group___h5_d.html#gae47c3f38db49db127faf221624c30609" title="Closes the specified dataset.">H5Dclose()</a>, <a class="el" href="group___h5_g.html#ga8dbe20b390d2504f0bd3589ed8f4e221" title="Closes the specified group.">H5Gclose()</a>, etc.) to call after a call to <a class="el" href="group___h5_r.html#ga5dc19b9d1833af66c5e1f819f2c05c4a">H5Rdereference()</a>.</p>
<dl class="section note"><dt>Note</dt><dd>Note that this function returns only the type of object that <code>id</code> would identify if it were valid; it does not determine whether <code>id</code> is valid identifier. Validity can be determined with a call to <a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a" title="Determines whether an identifier is valid.">H5Iis_valid()</a>. </dd></dl>
</div>
</div>
<a id="ga3fd0c157704573965cafd6e1aa7f368f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga3fd0c157704573965cafd6e1aa7f368f">◆ </a></span>H5Iinc_ref()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">int H5Iinc_ref </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Increments the reference count for an object. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a non-negative reference count of the object ID after incrementing it if successful; otherwise a negative value is returned.</dd></dl>
<p><a class="el" href="group___h5_i.html#ga3fd0c157704573965cafd6e1aa7f368f" title="Increments the reference count for an object.">H5Iinc_ref()</a> increments the reference count of the object identified by <code>id</code>.</p>
<p>The reference count for an object ID is attached to the information about an object in memory and has no relation to the number of links to an object on disk.</p>
<p>The reference count for a newly created object will be 1. Reference counts for objects may be explicitly modified with this function or with <a class="el" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9" title="Decrements the reference count for an object.">H5Idec_ref()</a>. When an object ID's reference count reaches zero, the object will be closed. Calling an object ID's <code>close</code> function decrements the reference count for the ID which normally closes the object, but if the reference count for the ID has been incremented with this function, the object will only be closed when the reference count reaches zero with further calls to <a class="el" href="group___h5_i.html#gaea2aa78caea892edf2a6a6ac70486ed9" title="Decrements the reference count for an object.">H5Idec_ref()</a> or the object ID's <code>close</code> function.</p>
<p>If the object ID was created by a collective parallel call (such as <a class="el" href="group___h5_d.html#ga0647ba4bbd26d5230cc07f3a5685b2cf">H5Dcreate()</a>, <a class="el" href="group___h5_g.html#ga3eca6807deff4f9e51fc5fe0befc2245">H5Gopen()</a>, etc.), the reference count should be modified by all the processes which have copies of the ID. Generally this means that group, dataset, attribute, file and named datatype IDs should be modified by all the processes and that all other types of IDs are safe to modify by individual processes.</p>
<p>This function is of particular value when an application is maintaining multiple copies of an object ID. The object ID can be incremented when a copy is made. Each copy of the ID can then be safely closed or decremented and the HDF5 object will be closed when the reference count for that that object drops to zero.</p>
<dl class="section since"><dt>Since</dt><dd>1.6.2 </dd></dl>
</div>
</div>
<a id="ga20eb10c559d9ed5ba6f77b31d6a3ba9a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga20eb10c559d9ed5ba6f77b31d6a3ba9a">◆ </a></span>H5Iis_valid()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5public_8h.html#aa8f6c28736dbd0f18388c67911d38aca">htri_t</a> H5Iis_valid </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> </td>
<td class="paramname"><em>id</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Determines whether an identifier is valid. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">id</td><td>Object identifier</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns zero (false), a positive (true) or a negative (failure) value.</dd></dl>
<p><a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a" title="Determines whether an identifier is valid.">H5Iis_valid()</a> determines whether the identifier <code>id</code> is valid.</p>
<p>Valid identifiers are those that have been obtained by an application and can still be used to access the original target. Examples of invalid identifiers include: </p><ul>
<li>Out-of-range values: negative, for example </li>
<li>Previously-valid identifiers that have been released: for example, a dataset identifier for which the dataset has been closed</li>
</ul>
<p><a class="el" href="group___h5_i.html#ga20eb10c559d9ed5ba6f77b31d6a3ba9a" title="Determines whether an identifier is valid.">H5Iis_valid()</a> can be used with any type of identifier: object identifier, property list identifier, attribute identifier, error message identifier, etc. When necessary, a call to <a class="el" href="group___h5_i.html#ga4941435d4d64de3d7095d2316f415f2d" title="Retrieves the type of an object.">H5Iget_type()</a> can determine the type of object that the <code>id</code> identifies.</p>
<dl class="section since"><dt>Since</dt><dd>1.8.3 </dd></dl>
</div>
</div>
<a id="gad61703cd16f392fb194da648099e69a9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gad61703cd16f392fb194da648099e69a9">◆ </a></span>H5Iregister_future()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="_h5_ipublic_8h.html#a0045db7ff9c22ad35db6ae91662e1943">hid_t</a> H5Iregister_future </td>
<td>(</td>
<td class="paramtype"><a class="el" href="_h5_ipublic_8h.html#a13afe14178faf81b89fa2167e7ab832b">H5I_type_t</a> </td>
<td class="paramname"><em>type</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const void * </td>
<td class="paramname"><em>object</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="_h5_idevelop_8h.html#ab0f349ec701c3d8c6ded067f160da44c">H5I_future_realize_func_t</a> </td>
<td class="paramname"><em>realize_cb</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype"><a class="el" href="_h5_idevelop_8h.html#a127fbac3b8283a7804d8470676a65518">H5I_future_discard_func_t</a> </td>
<td class="paramname"><em>discard_cb</em> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Registers a "future" object under a type and returns an ID for it. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>The identifier of the type of the new ID </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">object</td><td>Pointer to "future" object for which a new ID is created </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">realize_cb</td><td>Function pointer to realize a future object </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">discard_cb</td><td>Function pointer to destroy a future object</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Returns a object identifier if successful; otherwise returns <a class="el" href="_h5_ipublic_8h.html#a01eab13dccc91afd6909d74dccb780ba">H5I_INVALID_HID</a>.</dd></dl>
<p><a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9" title="Registers a "future" object under a type and returns an ID for it.">H5Iregister_future()</a> creates and returns a new ID for a "future" object. Future objects are a special kind of object and represent a placeholder for an object that has not yet been created or opened. The <code>realize_cb</code> will be invoked by the HDF5 library to 'realize' the future object as an actual object. A call to <a class="el" href="group___h5_i_u_d.html#gaafb1c684673762bc83546e1216fa6b10" title="Returns the object referenced by an ID.">H5Iobject_verify()</a> will invoke the <code>realize_cb</code> callback and if it successfully returns, will return the actual object, not the future object.</p>
<p>The <code>type</code> parameter is the identifier for the ID type to which this new future ID will belong. This identifier may have been created by a call to <a class="el" href="group___h5_i_u_d.html#gae10d4baa1335b2d1f1aecffb305e1613" title="Creates and returns a new ID type.">H5Iregister_type()</a> or may be one of the HDF5 pre-defined ID classes (e.g. H5I_FILE, H5I_GROUP, H5I_DATASPACE, etc).</p>
<p>The <code>object</code> parameter is a pointer to the memory which the new ID will be a reference to. This pointer will be stored by the library, but will not be returned to a call to <a class="el" href="group___h5_i_u_d.html#gaafb1c684673762bc83546e1216fa6b10" title="Returns the object referenced by an ID.">H5Iobject_verify()</a> until the <code>realize_cb</code> callback has returned the actual pointer for the object.</p>
<p>A NULL value for <code>object</code> is allowed.</p>
<p>The <code>realize_cb</code> parameter is a function pointer that will be invoked by the HDF5 library to convert a future object into an actual object. The <code>realize_cb</code> function may be invoked by <a class="el" href="group___h5_i_u_d.html#gaafb1c684673762bc83546e1216fa6b10" title="Returns the object referenced by an ID.">H5Iobject_verify()</a> to return the actual object for a user-defined ID class (i.e. an ID class registered with <a class="el" href="group___h5_i_u_d.html#gae10d4baa1335b2d1f1aecffb305e1613" title="Creates and returns a new ID type.">H5Iregister_type()</a>) or internally by the HDF5 library in order to use or get information from an HDF5 pre-defined ID type. For example, the <code>realize_cb</code> for a future dataspace object will be called during the process of returning information from <a class="el" href="group___h5_s.html#gac494409b615d8e67c5edd9eb2848b2f3" title="Retrieves dataspace dimension size and maximum size.">H5Sget_simple_extent_dims()</a>.</p>
<p>Note that although the <code>realize_cb</code> routine returns an ID (as a parameter) for the actual object, the HDF5 library will swap the actual object in that ID for the future object in the future ID. This ensures that the ID value for the object doesn't change for the user when the object is realized.</p>
<p>Note that the <code>realize_cb</code> callback could receive a NULL value for a future object pointer, if one was used when <a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9" title="Registers a "future" object under a type and returns an ID for it.">H5Iregister_future()</a> was initially called. This is permitted as a means of allowing the <code>realize_cb</code> to act as a generator of new objects, without requiring creation of unnecessary future objects.</p>
<p>It is an error to pass NULL for <code>realize_cb</code>.</p>
<p>The <code>discard_cb</code> parameter is a function pointer that will be invoked by the HDF5 library to destroy a future object. This callback will always be invoked for <em>every</em> future object, whether the <code>realize_cb</code> is invoked on it or not. It's possible that the <code>discard_cb</code> is invoked on a future object without the <code>realize_cb</code> being invoked, e.g. when a future ID is closed without requiring the future object to be realized into an actual one.</p>
<p>Note that the <code>discard_cb</code> callback could receive a NULL value for a future object pointer, if one was used when <a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9" title="Registers a "future" object under a type and returns an ID for it.">H5Iregister_future()</a> was initially called.</p>
<p>It is an error to pass NULL for <code>discard_cb</code>.</p>
<dl class="section note"><dt>Note</dt><dd>The <a class="el" href="group___h5_i.html#gad61703cd16f392fb194da648099e69a9" title="Registers a "future" object under a type and returns an ID for it.">H5Iregister_future()</a> function is primarily targeted at VOL connector authors and is <em>not</em> designed for general-purpose application use. </dd></dl>
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="footer">Generated by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>
|