radarlib  1.4.6
odimh5v20_hdf5.hpp
Go to the documentation of this file.
1 /*
2  * Radar Library
3  *
4  * Copyright (C) 2009-2010 ARPA-SIM <urpsim@smr.arpa.emr.it>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License along
17  * with this program; if not, write to the Free Software Foundation, Inc.,
18  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19  *
20  * Author: Guido Billi <guidobilli@gmail.com>
21  */
22 
27 #ifndef __RADAR_ODIMH5V20_HDF5_HPP__
28 #define __RADAR_ODIMH5V20_HDF5_HPP__
29 
30 /*===========================================================================*/
31 /*
32 /* INTERNAL HEADER FILE USED INSIDE THE LIRARY
33 /*
34 /*===========================================================================*/
35 
36 #include <radarlib/defs.h>
37 
38 /* sotto windows bisogna utilizzare queste macro per poter usare la DLL */
39 #ifndef _HDF5USEDLL_
40 #define _HDF5USEDLL_
41 #endif
42 #ifndef HDF5CPP_USEDLL
43 #define HDF5CPP_USEDLL
44 #endif
45 
46 #include "H5Cpp.h"
47 //#ifndef H5_NO_NAMESPACE
48 //using namespace H5;
49 //#endif
50 
51 #include <set>
52 
53 namespace OdimH5v20 {
54 
55 /*===========================================================================*/
56 /* HDF5 FILE */
57 /*===========================================================================*/
58 
64 class RADAR_API HDF5File
65 {
66 public:
75  static H5::H5File* open (const std::string& path, int h5flags);
82  static H5::Group* getRoot (H5::H5File* file);
83 };
84 
85 /*===========================================================================*/
86 /* HDF5 ATTRIBUTE */
87 /*===========================================================================*/
88 
94 class RADAR_API HDF5Attribute
95 {
96 public:
107  static H5::Attribute* get (H5::H5Object* obj, const char* name, bool mandatory);
116  static bool exists (H5::H5Object* obj, const char* name);
125  static void remove (H5::H5Object* obj, const char* name);
134  static std::string getName (H5::Attribute* attr);
135 
147  static void set (H5::H5Object* obj, const char* name, int64_t value);
159  static void set (H5::H5Object* obj, const char* name, double value);
171  static void set (H5::H5Object* obj, const char* name, const char* value);
183  static void set (H5::H5Object* obj, const char* name, const std::string& value);
184 
194  static int64_t getLong (H5::H5Object* obj, const char* name);
204  static int64_t getLong (H5::H5Object* obj, const char* name, int64_t defaultValue);
214  static double getDouble (H5::H5Object* obj, const char* name);
225  static double getDouble (H5::H5Object* obj, const char* name, double defaultValue);
235  static std::string getStr (H5::H5Object* obj, const char* name);
246  static std::string getStr (H5::H5Object* obj, const char* name, const std::string& defaultValue);
247 
248 };
249 
250 /*===========================================================================*/
251 /* HDF5 GROUP */
252 /*===========================================================================*/
253 
259 class RADAR_API HDF5Group
260 {
261 public:
270  static int getChildCount (H5::Group* parent, const char* prefix);
280  static H5::Group* getChild (H5::Group* parent, const char* name);
289  static void ensureChild (H5::Group* parent, const char* name);
299  static H5::Group* ensureGetChild (H5::Group* parent, const char* name);
308  static void removeChild (H5::Group* parent, const char* name);
309 
318  static bool exists (H5::Group* parent, const char* name);
327  static H5::DataSet* getDataset (H5::Group* parent, const char* name);
336  static void copyAttributes (H5::Group* src, H5::Group* dst);
346  static void copyAttributes (H5::Group* src, H5::Group* dst, const std::set<std::string>& names);
347 };
348 
349 /*===========================================================================*/
350 /* HDF5 ATOM TYPE */
351 /*===========================================================================*/
352 
358 class RADAR_API HDF5AtomType
359 {
360 public:
370  static H5::AtomType fromDataType(const H5::DataType& type);
371 };
372 
373 
374 /*===========================================================================*/
375 
376 }
377 
378 #endif
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 
HDF5Group class.
Definition: odimh5v20_hdf5.hpp:359
HDF5Attribute class.
Definition: odimh5v20_hdf5.hpp:95
HDF5File class.
Definition: odimh5v20_hdf5.hpp:65
HDF5Group class.
Definition: odimh5v20_hdf5.hpp:260
Internal library macros.
Namespace related to ODIMH5 version 2.0.
Definition: odimh5v20.hpp:46