Field3D

Scoped object - opens a group on creation and closes it on destruction. More...

#include <Hdf5Util.h>

Inheritance diagram for Hdf5Util::H5ScopedGopen:
Hdf5Util::H5Base

Public Member Functions

 H5ScopedGopen ()
 
 H5ScopedGopen (hid_t parentLocation, const std::string &name)
 
 H5ScopedGopen (hid_t parentLocation, const std::string &name, hid_t gapl_id)
 
void open (hid_t parentLocation, const std::string &name)
 
void open (hid_t parentLocation, const std::string &name, hid_t gapl_id)
 
 ~H5ScopedGopen ()
 
- Public Member Functions inherited from Hdf5Util::H5Base
 H5Base ()
 
hid_t id () const
 Query the hid_t value. More...
 
 operator hid_t ()
 Implicit cast to hid_t. More...
 

Additional Inherited Members

- Protected Attributes inherited from Hdf5Util::H5Base
hid_t m_id
 

Detailed Description

Scoped object - opens a group on creation and closes it on destruction.

Definition at line 194 of file Hdf5Util.h.

Constructor & Destructor Documentation

◆ H5ScopedGopen() [1/3]

Hdf5Util::H5ScopedGopen::H5ScopedGopen ( )
inline

Definition at line 197 of file Hdf5Util.h.

198  : H5Base()
199  {
200  // Empty
201  }

◆ H5ScopedGopen() [2/3]

Hdf5Util::H5ScopedGopen::H5ScopedGopen ( hid_t  parentLocation,
const std::string &  name 
)
inline

Definition at line 202 of file Hdf5Util.h.

203  {
204  open(parentLocation, name);
205  }

References open().

◆ H5ScopedGopen() [3/3]

Hdf5Util::H5ScopedGopen::H5ScopedGopen ( hid_t  parentLocation,
const std::string &  name,
hid_t  gapl_id 
)
inline

Definition at line 206 of file Hdf5Util.h.

207  {
208  open(parentLocation, name, gapl_id);
209  }

References open().

◆ ~H5ScopedGopen()

Hdf5Util::H5ScopedGopen::~H5ScopedGopen ( )
inline

Definition at line 221 of file Hdf5Util.h.

222  {
223  GlobalLock lock(g_hdf5Mutex);
224  if (m_id >= 0)
225  H5Gclose(m_id);
226  }

References g_hdf5Mutex, and Hdf5Util::H5Base::m_id.

Member Function Documentation

◆ open() [1/2]

void Hdf5Util::H5ScopedGopen::open ( hid_t  parentLocation,
const std::string &  name 
)
inline

Definition at line 210 of file Hdf5Util.h.

211  {
212  GlobalLock lock(g_hdf5Mutex);
213  m_id = H5Gopen(parentLocation, name.c_str(), H5P_DEFAULT);
214  }

References g_hdf5Mutex, and Hdf5Util::H5Base::m_id.

Referenced by H5ScopedGopen().

◆ open() [2/2]

void Hdf5Util::H5ScopedGopen::open ( hid_t  parentLocation,
const std::string &  name,
hid_t  gapl_id 
)
inline

Definition at line 215 of file Hdf5Util.h.

216  {
217  GlobalLock lock(g_hdf5Mutex);
218  m_id = H5Gopen(parentLocation, name.c_str(), gapl_id);
219  }

References g_hdf5Mutex, and Hdf5Util::H5Base::m_id.


The documentation for this class was generated from the following file:
Hdf5Util::H5Base::H5Base
H5Base()
Definition: Hdf5Util.h:96
Hdf5Util::H5ScopedGopen::open
void open(hid_t parentLocation, const std::string &name)
Definition: Hdf5Util.h:210
g_hdf5Mutex
FIELD3D_NAMESPACE_OPEN FIELD3D_API boost::recursive_mutex g_hdf5Mutex
Definition: Hdf5Util.cpp:67
GlobalLock
boost::recursive_mutex::scoped_lock GlobalLock
Definition: Hdf5Util.h:78
Hdf5Util::H5Base::m_id
hid_t m_id
Definition: Hdf5Util.h:106