IFEM  90A354
HDF5Base.h
Go to the documentation of this file.
1 // $Id$
2 //==============================================================================
12 //==============================================================================
13 
14 #ifndef _HDF5_BASE_H
15 #define _HDF5_BASE_H
16 
17 #include <string>
18 #ifdef HAS_HDF5
19 #include <hdf5.h>
20 #endif
21 
22 class ProcessAdm;
23 
24 
29 class HDF5Base
30 {
31 public:
35  HDF5Base(const std::string& name, const ProcessAdm& adm);
37  virtual ~HDF5Base() { this->closeFile(); }
38 
39 protected:
42  bool openFile(unsigned int flag);
44  void closeFile();
45 
46 #ifdef HAS_HDF5
51  static bool checkGroupExistence(hid_t parent, const char* path);
52 
53  hid_t m_file;
54 #endif
55  std::string m_hdf5_name;
56 #ifdef HAVE_MPI
57  const ProcessAdm& m_adm;
58 #endif
59 };
60 
61 #endif
Base class for interacting with HDF5 files.
Definition: HDF5Base.h:30
bool openFile(unsigned int flag)
Opens the HDF5 file.
Definition: HDF5Base.C:38
void closeFile()
Closes the HDF5 file.
Definition: HDF5Base.C:81
std::string m_hdf5_name
The file name of the HDF5 file.
Definition: HDF5Base.h:55
virtual ~HDF5Base()
The destructor closes the file.
Definition: HDF5Base.h:37
HDF5Base(const std::string &name, const ProcessAdm &adm)
The constructor opens a named HDF5-file.
Definition: HDF5Base.C:26
Class for administration of MPI processes in IFEM library.
Definition: ProcessAdm.h:33