Field3D
Hdf5Util.cpp
Go to the documentation of this file.
1 //----------------------------------------------------------------------------//
2 
3 /*
4  * Copyright (c) 2009 Sony Pictures Imageworks Inc
5  *
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions
10  * are met:
11  *
12  * Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in the
16  * documentation and/or other materials provided with the
17  * distribution. Neither the name of Sony Pictures Imageworks nor the
18  * names of its contributors may be used to endorse or promote
19  * products derived from this software without specific prior written
20  * permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
25  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
26  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
29  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
31  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
33  * OF THE POSSIBILITY OF SUCH DAMAGE.
34  */
35 
36 //----------------------------------------------------------------------------//
37 
44 //----------------------------------------------------------------------------//
45 
46 #include "Hdf5Util.h"
47 
48 #include <iostream>
49 #include <vector>
50 
51 //----------------------------------------------------------------------------//
52 
53 using namespace std;
54 
55 //----------------------------------------------------------------------------//
56 
58 
59 using namespace Exc;
60 
61 namespace Hdf5Util {
62 
63 //----------------------------------------------------------------------------//
64 // Implementations
65 //----------------------------------------------------------------------------//
66 
67 bool
68 readAttribute(hid_t location, const string& attrName, string& value)
69 {
70  H5T_class_t typeClass;
71  H5A_info_t attrInfo;
72  hsize_t strLen;
73 
74  if (H5Aexists(location, attrName.c_str()) < 1)
75  throw MissingAttributeException("Couldn't find attribute " + attrName);
76 
77  H5ScopedAopen attr(location, attrName.c_str(), H5P_DEFAULT);
78  H5ScopedAget_space attrSpace(attr);
79  H5ScopedAget_type attrType(attr);
80 
81  if (H5Aget_info(attr, &attrInfo) < 0) {
82  throw MissingAttributeException("Couldn't get attribute info " + attrName);
83  } else {
84  strLen = attrInfo.data_size;
85  }
86 
87  typeClass = H5Tget_class(attrType);
88 
89  if (typeClass != H5T_STRING)
90  throw MissingAttributeException("Bad attribute type class for " + attrName);
91 
92  H5ScopedTget_native_type nativeType(attrType, H5T_DIR_ASCEND);
93 
94  std::vector<char> tempString(strLen + 1);
95 
96  if (H5Aread(attr, nativeType, &tempString[0]) < 0)
97  throw MissingAttributeException("Couldn't read attribute " + attrName);
98 
99  value = string(&tempString[0]);
100 
101  return true;
102 
103 }
104 
105 //----------------------------------------------------------------------------//
106 
107 bool
108 readAttribute(hid_t location, const string& attrName,
109  unsigned int attrSize, int &value)
110 {
111  H5T_class_t typeClass;
112 
113  if (H5Aexists(location, attrName.c_str()) < 1)
114  throw MissingAttributeException("Couldn't find attribute " + attrName);
115 
116  H5ScopedAopen attr(location, attrName.c_str(), H5P_DEFAULT);
117  H5ScopedAget_space attrSpace(attr);
118  H5ScopedAget_type attrType(attr);
119 
120  if (H5Sget_simple_extent_ndims(attrSpace) != 1)
121  throw MissingAttributeException("Bad attribute rank for attribute " +
122  attrName);
123 
124  hsize_t dims[1];
125  H5Sget_simple_extent_dims(attrSpace, dims, NULL);
126 
127  if (dims[0] != attrSize)
128  throw MissingAttributeException("Invalid attribute size for attribute " +
129  attrName);
130 
131  typeClass = H5Tget_class(attrType);
132 
133  if (typeClass != H5T_INTEGER)
134  throw MissingAttributeException("Bad attribute type class for " +
135  attrName);
136 
137  H5ScopedTget_native_type nativeType(attrType, H5T_DIR_ASCEND);
138 
139  if (H5Aread(attr, nativeType, &value) < 0)
140  throw MissingAttributeException("Couldn't read attribute " + attrName);
141 
142  return true;
143 
144 }
145 
146 //----------------------------------------------------------------------------//
147 
148 bool
149 readAttribute(hid_t location, const string& attrName,
150  unsigned int attrSize, float &value)
151 {
152  H5T_class_t typeClass;
153 
154  if (H5Aexists(location, attrName.c_str()) < 1)
155  throw MissingAttributeException("Couldn't find attribute " + attrName);
156 
157  H5ScopedAopen attr(location, attrName.c_str(), H5P_DEFAULT);
158  H5ScopedAget_space attrSpace(attr);
159  H5ScopedAget_type attrType(attr);
160 
161  if (H5Sget_simple_extent_ndims(attrSpace) != 1)
162  throw MissingAttributeException("Bad attribute rank for attribute " +
163  attrName);
164 
165  hsize_t dims[1];
166  H5Sget_simple_extent_dims(attrSpace, dims, NULL);
167 
168  if (dims[0] != attrSize)
169  throw MissingAttributeException("Invalid attribute size for attribute " +
170  attrName);
171 
172  typeClass = H5Tget_class(attrType);
173 
174  if (typeClass != H5T_FLOAT)
175  throw MissingAttributeException("Bad attribute type class for " +
176  attrName);
177 
178  H5ScopedTget_native_type nativeType(attrType, H5T_DIR_ASCEND);
179 
180  if (H5Aread(attr, nativeType, &value) < 0)
181  throw MissingAttributeException("Couldn't read attribute " + attrName);
182 
183  return true;
184 }
185 
186 //----------------------------------------------------------------------------//
187 
188 bool
189 readAttribute(hid_t location, const string& attrName,
190  unsigned int attrSize, double &value)
191 {
192  H5T_class_t typeClass;
193 
194  if (H5Aexists(location, attrName.c_str()) < 0)
195  throw MissingAttributeException("Couldn't find attribute " + attrName);
196 
197  H5ScopedAopen attr(location, attrName.c_str(), H5P_DEFAULT);
198  H5ScopedAget_space attrSpace(attr);
199  H5ScopedAget_type attrType(attr);
200 
201  if (H5Sget_simple_extent_ndims(attrSpace) != 1)
202  throw MissingAttributeException("Bad attribute rank for attribute " +
203  attrName);
204 
205  hsize_t dims[1];
206  H5Sget_simple_extent_dims(attrSpace, dims, NULL);
207 
208  if (dims[0] != attrSize)
209  throw MissingAttributeException("Invalid attribute size for attribute " +
210  attrName);
211 
212  typeClass = H5Tget_class(attrType);
213 
214  if (typeClass != H5T_FLOAT)
215  throw MissingAttributeException("Bad attribute type class for " +
216  attrName);
217 
218  H5ScopedTget_native_type nativeType(attrType, H5T_DIR_ASCEND);
219 
220  if (H5Aread(attr, nativeType, &value) < 0)
221  throw MissingAttributeException("Couldn't read attribute " + attrName);
222 
223  return true;
224 }
225 
226 //----------------------------------------------------------------------------//
227 
228 bool
229 readAttribute(hid_t location, const string& attrName,
230  std::vector<unsigned int> &attrSize, int &value)
231 {
232  H5T_class_t typeClass;
233  int rank = attrSize.size();
234 
235  if (H5Aexists(location, attrName.c_str()) < 0)
236  throw MissingAttributeException("Couldn't find attribute " + attrName);
237 
238  H5ScopedAopen attr(location, attrName.c_str(), H5P_DEFAULT);
239  H5ScopedAget_space attrSpace(attr);
240  H5ScopedAget_type attrType(attr);
241 
242 
243  if (H5Sget_simple_extent_ndims(attrSpace) != rank)
244  throw MissingAttributeException("Bad attribute rank for attribute " +
245  attrName);
246 
247  hsize_t dims[rank];
248  H5Sget_simple_extent_dims(attrSpace, dims, NULL);
249 
250  for (int i=0; i < rank; i++) {
251  if (dims[i] != attrSize[i])
252  throw MissingAttributeException("Invalid attribute size for attribute " +
253  attrName);
254  }
255 
256  typeClass = H5Tget_class(attrType);
257 
258  if (typeClass != H5T_INTEGER)
259  throw MissingAttributeException("Bad attribute type class for " +
260  attrName);
261 
262  H5ScopedTget_native_type nativeType(attrType, H5T_DIR_ASCEND);
263 
264  if (H5Aread(attr, nativeType, &value) < 0)
265  throw MissingAttributeException("Couldn't read attribute " + attrName);
266 
267  return true;
268 }
269 
270 //----------------------------------------------------------------------------//
271 
272 bool
273 readAttribute(hid_t location, const string& attrName,
274  std::vector<unsigned int> &attrSize, float &value)
275 {
276  H5T_class_t typeClass;
277  int rank = attrSize.size();
278 
279  if (H5Aexists(location, attrName.c_str()) < 0)
280  throw MissingAttributeException("Couldn't find attribute " + attrName);
281 
282  H5ScopedAopen attr(location, attrName.c_str(), H5P_DEFAULT);
283  H5ScopedAget_space attrSpace(attr);
284  H5ScopedAget_type attrType(attr);
285 
286 
287  if (H5Sget_simple_extent_ndims(attrSpace) != rank)
288  throw MissingAttributeException("Bad attribute rank for attribute " +
289  attrName);
290 
291  hsize_t dims[rank];
292  H5Sget_simple_extent_dims(attrSpace, dims, NULL);
293 
294  for (int i=0; i < rank; i++) {
295  if (dims[i] != attrSize[i])
296  throw MissingAttributeException("Invalid attribute size for attribute " +
297  attrName);
298  }
299 
300  typeClass = H5Tget_class(attrType);
301 
302  if (typeClass != H5T_FLOAT)
303  throw MissingAttributeException("Bad attribute type class for " +
304  attrName);
305 
306  H5ScopedTget_native_type nativeType(attrType, H5T_DIR_ASCEND);
307 
308  if (H5Aread(attr, nativeType, &value) < 0)
309  throw MissingAttributeException("Couldn't read attribute " + attrName);
310 
311  return true;
312 }
313 
314 //----------------------------------------------------------------------------//
315 
316 bool
317 readAttribute(hid_t location, const string& attrName,
318  std::vector<unsigned int> &attrSize, double &value)
319 {
320 
321  H5T_class_t typeClass;
322  int rank = attrSize.size();
323 
324  if (H5Aexists(location, attrName.c_str()) < 0)
325  throw MissingAttributeException("Couldn't find attribute " + attrName);
326 
327  H5ScopedAopen attr(location, attrName.c_str(), H5P_DEFAULT);
328  H5ScopedAget_space attrSpace(attr);
329  H5ScopedAget_type attrType(attr);
330 
331 
332  if (H5Sget_simple_extent_ndims(attrSpace) != rank)
333  throw MissingAttributeException("Bad attribute rank for attribute " +
334  attrName);
335 
336  hsize_t dims[rank];
337  H5Sget_simple_extent_dims(attrSpace, dims, NULL);
338 
339  for (int i=0; i < rank; i++) {
340  if (dims[i] != attrSize[i])
341  throw MissingAttributeException("Invalid attribute size for attribute " +
342  attrName);
343  }
344 
345  typeClass = H5Tget_class(attrType);
346 
347  if (typeClass != H5T_FLOAT)
348  throw MissingAttributeException("Bad attribute type class for " +
349  attrName);
350 
351  H5ScopedTget_native_type nativeType(attrType, H5T_DIR_ASCEND);
352 
353  if (H5Aread(attr, nativeType, &value) < 0)
354  throw MissingAttributeException("Couldn't read attribute " + attrName);
355 
356  return true;
357 }
358 
359 //----------------------------------------------------------------------------//
360 
361 bool
362 writeAttribute(hid_t location, const string& attrName, const string &value)
363 {
364  hid_t attr = -1;
365  hid_t attrSpace;
366  hid_t attrType;
367 
368  bool success = true;
369 
370  attrSpace = H5Screate(H5S_SCALAR);
371  if (attrSpace == -1)
372  success = false;
373 
374  attrType = H5Tcopy(H5T_C_S1);
375  if (attrType == -1)
376  success = false;
377 
378  if (value.size()) {
379  // if the string is null the following will return error
380  // which we don't want.
381  if (success && H5Tset_size(attrType, value.size()) == -1){
382  success = false;
383  }
384  }
385 
386  if (success) {
387  H5Tset_strpad(attrType, H5T_STR_NULLTERM);
388  attr = H5Acreate(location, attrName.c_str(), attrType, attrSpace,
389  H5P_DEFAULT, H5P_DEFAULT);
390  }
391 
392  if (attr == -1) {
393  Msg::print(Msg::SevWarning, "Error creating attribute: " + attrName);
394  success = false;
395  }
396 
397  if (success && H5Awrite(attr, attrType, value.c_str()) == -1) {
398  Msg::print(Msg::SevWarning, "Error writing attribute: " + attrName);
399  success = false;
400  }
401 
402  H5Aclose(attr);
403  H5Tclose(attrType);
404  H5Sclose(attrSpace);
405 
406  return success;
407 
408 }
409 
410 //----------------------------------------------------------------------------//
411 
412 bool
413 writeAttribute(hid_t location, const string &attrName,
414  unsigned int attrSize, const int &value)
415 {
416  hid_t attr;
417  hid_t attrSpace;
418  hsize_t dims[1];
419 
420  dims[0] = attrSize;
421 
422  attrSpace = H5Screate(H5S_SIMPLE);
423  if (attrSpace < 0)
424  return false;
425 
426  if (H5Sset_extent_simple(attrSpace, 1, dims, NULL) < 0)
427  return false;
428 
429  attr = H5Acreate(location, attrName.c_str(), H5T_NATIVE_INT,
430  attrSpace, H5P_DEFAULT, H5P_DEFAULT);
431  if (attr < 0) {
432  Msg::print(Msg::SevWarning, "Error creating attribute: " + attrName);
433  H5Aclose(attr);
434  H5Sclose(attrSpace);
435  return false;
436  }
437 
438  if (H5Awrite(attr, H5T_NATIVE_INT, &value) < 0) {
439  Msg::print(Msg::SevWarning, "Error writing attribute: " + attrName);
440  H5Aclose(attr);
441  H5Sclose(attrSpace);
442  return false;
443  }
444 
445  H5Aclose(attr);
446  H5Sclose(attrSpace);
447 
448  return true;
449 }
450 
451 //----------------------------------------------------------------------------//
452 
453 bool
454 writeAttribute(hid_t location, const string& attrName,
455  unsigned int attrSize, const float &value)
456 {
457  hid_t attr;
458  hid_t attrSpace;
459  hsize_t dims[1];
460 
461  dims[0] = attrSize;
462 
463  attrSpace = H5Screate(H5S_SIMPLE);
464  if (attrSpace < 0)
465  return false;
466 
467  if (H5Sset_extent_simple(attrSpace, 1, dims, NULL) < 0)
468  return false;
469 
470  attr = H5Acreate(location, attrName.c_str(), H5T_NATIVE_FLOAT,
471  attrSpace, H5P_DEFAULT, H5P_DEFAULT);
472  if (attr < 0) {
473  Msg::print(Msg::SevWarning, "Error creating attribute: " + attrName);
474  H5Aclose(attr);
475  H5Sclose(attrSpace);
476  return false;
477  }
478 
479  if (H5Awrite(attr, H5T_NATIVE_FLOAT, &value) < 0) {
480  Msg::print(Msg::SevWarning, "Error writing attribute: " + attrName);
481  H5Aclose(attr);
482  H5Sclose(attrSpace);
483  return false;
484  }
485 
486  H5Aclose(attr);
487  H5Sclose(attrSpace);
488 
489  return true;
490 }
491 
492 //----------------------------------------------------------------------------//
493 
494 bool
495 writeAttribute(hid_t location, const string& attrName,
496  unsigned int attrSize, const double &value)
497 {
498  hid_t attr;
499  hid_t attrSpace;
500  hsize_t dims[1];
501 
502  dims[0] = attrSize;
503 
504  attrSpace = H5Screate(H5S_SIMPLE);
505  if (attrSpace < 0)
506  return false;
507 
508  if (H5Sset_extent_simple(attrSpace, 1, dims, NULL) < 0)
509  return false;
510 
511  attr = H5Acreate(location, attrName.c_str(), H5T_NATIVE_DOUBLE,
512  attrSpace, H5P_DEFAULT, H5P_DEFAULT);
513  if (attr < 0) {
514  Msg::print(Msg::SevWarning, "Error creating attribute: " + attrName);
515  H5Aclose(attr);
516  H5Sclose(attrSpace);
517  return false;
518  }
519 
520  if (H5Awrite(attr, H5T_NATIVE_DOUBLE, &value) < 0) {
521  Msg::print(Msg::SevWarning, "Error writing attribute: " + attrName);
522  H5Aclose(attr);
523  H5Sclose(attrSpace);
524  return false;
525  }
526 
527  H5Aclose(attr);
528  H5Sclose(attrSpace);
529 
530  return true;
531 }
532 
533 
534 //----------------------------------------------------------------------------//
535 
536 bool
537 writeAttribute(hid_t location, const string& attrName,
538  std::vector<unsigned int> &attrSize, const int &value)
539 {
540  hid_t attr;
541  hid_t attrSpace;
542  size_t rank = attrSize.size();
543  hsize_t current_dims[rank];
544  hsize_t max_dims[rank];
545 
546  for (size_t i=0; i < rank; i++)
547  current_dims[i] = attrSize[i];
548 
549  for (size_t i=0; i < rank; i++)
550  max_dims[i] = H5S_UNLIMITED;
551 
552  attrSpace = H5Screate(H5S_SIMPLE);
553  if (attrSpace < 0)
554  return false;
555 
556  if (H5Sset_extent_simple(attrSpace, rank, current_dims, max_dims) < 0) {
557  return false;
558  }
559 
560  attr = H5Acreate(location, attrName.c_str(), H5T_NATIVE_INT,
561  attrSpace, H5P_DEFAULT, H5P_DEFAULT);
562  if (attr < 0) {
563  Msg::print(Msg::SevWarning, "Error creating attribute: " + attrName);
564  H5Aclose(attr);
565  H5Sclose(attrSpace);
566  return false;
567  }
568 
569  if (H5Awrite(attr, H5T_NATIVE_INT, &value) < 0) {
570  Msg::print(Msg::SevWarning, "Error writing attribute: " + attrName);
571  H5Aclose(attr);
572  H5Sclose(attrSpace);
573  return false;
574  }
575 
576  H5Aclose(attr);
577  H5Sclose(attrSpace);
578 
579  return true;
580 }
581 
582 //----------------------------------------------------------------------------//
583 
584 bool
585 writeAttribute(hid_t location, const string& attrName,
586  std::vector<unsigned int> &attrSize, const float &value)
587 {
588  hid_t attr;
589  hid_t attrSpace;
590  size_t rank = attrSize.size();
591  hsize_t current_dims[rank];
592  hsize_t max_dims[rank];
593 
594  for (size_t i=0; i < rank; i++)
595  current_dims[i] = attrSize[i];
596 
597  for (size_t i=0; i < rank; i++)
598  max_dims[i] = H5S_UNLIMITED;
599 
600  attrSpace = H5Screate(H5S_SIMPLE);
601  if (attrSpace < 0)
602  return false;
603 
604  if (H5Sset_extent_simple(attrSpace, rank, current_dims, max_dims) < 0) {
605  return false;
606  }
607 
608  attr = H5Acreate(location, attrName.c_str(), H5T_NATIVE_FLOAT,
609  attrSpace, H5P_DEFAULT, H5P_DEFAULT);
610  if (attr < 0) {
611  Msg::print(Msg::SevWarning, "Error creating attribute: " + attrName);
612  H5Aclose(attr);
613  H5Sclose(attrSpace);
614  return false;
615  }
616 
617  if (H5Awrite(attr, H5T_NATIVE_FLOAT, &value) < 0) {
618  Msg::print(Msg::SevWarning, "Error writing attribute: " + attrName);
619  H5Aclose(attr);
620  H5Sclose(attrSpace);
621  return false;
622  }
623 
624  H5Aclose(attr);
625  H5Sclose(attrSpace);
626 
627  return true;
628 }
629 
630 //----------------------------------------------------------------------------//
631 
632 bool
633 writeAttribute(hid_t location, const string& attrName,
634  std::vector<unsigned int> &attrSize, const double &value)
635 {
636  hid_t attr;
637  hid_t attrSpace;
638  size_t rank = attrSize.size();
639  hsize_t current_dims[rank];
640  hsize_t max_dims[rank];
641 
642  for (size_t i=0; i < rank; i++)
643  current_dims[i] = attrSize[i];
644 
645  for (size_t i=0; i < rank; i++)
646  max_dims[i] = H5S_UNLIMITED;
647 
648  attrSpace = H5Screate(H5S_SIMPLE);
649  if (attrSpace < 0)
650  return false;
651 
652  if (H5Sset_extent_simple(attrSpace, rank, current_dims, max_dims) < 0) {
653  return false;
654  }
655 
656  attr = H5Acreate(location, attrName.c_str(), H5T_NATIVE_DOUBLE,
657  attrSpace, H5P_DEFAULT, H5P_DEFAULT);
658  if (attr < 0) {
659  Msg::print(Msg::SevWarning, "Error creating attribute: " + attrName);
660  H5Aclose(attr);
661  H5Sclose(attrSpace);
662  return false;
663  }
664 
665  if (H5Awrite(attr, H5T_NATIVE_DOUBLE, &value) < 0) {
666  Msg::print(Msg::SevWarning, "Error writing attribute: " + attrName);
667  H5Aclose(attr);
668  H5Sclose(attrSpace);
669  return false;
670  }
671 
672  H5Aclose(attr);
673  H5Sclose(attrSpace);
674 
675  return true;
676 }
677 
678 //----------------------------------------------------------------------------//
679 
681 {
682  htri_t avail = H5Zfilter_avail(H5Z_FILTER_DEFLATE);
683  if (!avail)
684  return false;
685 
686  unsigned int filter_info;
687  herr_t status = H5Zget_filter_info (H5Z_FILTER_DEFLATE, &filter_info);
688 
689  if (status < 0)
690  return false;
691 
692  if (!(filter_info & H5Z_FILTER_CONFIG_ENCODE_ENABLED) ||
693  !(filter_info & H5Z_FILTER_CONFIG_DECODE_ENABLED)) {
694  return false;
695  }
696 
697  return true;
698 }
699 
700 //----------------------------------------------------------------------------//
701 
702 } // namespace Hdf5Util
703 
704 //----------------------------------------------------------------------------//
705 
707 
708 //----------------------------------------------------------------------------//
Scoped object - opens an attribute data type on creation and closes it on destruction.
Definition: Hdf5Util.h:283
Scoped object - opens an native type id on creation and closes it on destruction. ...
Definition: Hdf5Util.h:304
#define FIELD3D_NAMESPACE_SOURCE_CLOSE
Definition: ns.h:60
void print(Severity severity, const std::string &message)
Sends the string to the assigned output, prefixing the message with the severity. ...
Definition: Log.cpp:62
bool readAttribute(hid_t location, const string &attrName, std::vector< unsigned int > &attrSize, double &value)
Definition: Hdf5Util.cpp:317
Contains various utility functions for Hdf5.
Scoped object - Opens attribute by name and closes it on destruction.
Definition: Hdf5Util.h:103
bool checkHdf5Gzip()
Checks whether gzip is available in the current hdf5 library.
Definition: Hdf5Util.cpp:680
Scoped object - opens an attribute data space on creation and closes it on destruction.
Definition: Hdf5Util.h:262
bool writeAttribute(hid_t location, const string &attrName, std::vector< unsigned int > &attrSize, const double &value)
Definition: Hdf5Util.cpp:633
#define FIELD3D_NAMESPACE_OPEN
Definition: ns.h:56