Field3D

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

#include <Hdf5Util.h>

Inheritance diagram for Hdf5Util::H5ScopedDget_space:
Hdf5Util::H5Base

Public Member Functions

 H5ScopedDget_space ()
 
 H5ScopedDget_space (hid_t dataset_id)
 
void open (hid_t dataset_id)
 
 ~H5ScopedDget_space ()
 
- 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 dataset on creation and closes it on destruction.

Definition at line 386 of file Hdf5Util.h.

Constructor & Destructor Documentation

◆ H5ScopedDget_space() [1/2]

Hdf5Util::H5ScopedDget_space::H5ScopedDget_space ( )
inline

Definition at line 389 of file Hdf5Util.h.

390  : H5Base()
391  {
392  // Empty
393  }

◆ H5ScopedDget_space() [2/2]

Hdf5Util::H5ScopedDget_space::H5ScopedDget_space ( hid_t  dataset_id)
inline

Definition at line 394 of file Hdf5Util.h.

395  {
396  open(dataset_id);
397  }

References open().

◆ ~H5ScopedDget_space()

Hdf5Util::H5ScopedDget_space::~H5ScopedDget_space ( )
inline

Definition at line 403 of file Hdf5Util.h.

404  {
405  GlobalLock lock(g_hdf5Mutex);
406  if (m_id >= 0)
407  H5Sclose(m_id);
408  }

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

Member Function Documentation

◆ open()

void Hdf5Util::H5ScopedDget_space::open ( hid_t  dataset_id)
inline

Definition at line 398 of file Hdf5Util.h.

399  {
400  GlobalLock lock(g_hdf5Mutex);
401  m_id = H5Dget_space(dataset_id);
402  }

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

Referenced by H5ScopedDget_space(), SparseDataReader< Data_T >::readBlock(), and SparseDataReader< Data_T >::readBlockList().


The documentation for this class was generated from the following file:
Hdf5Util::H5Base::H5Base
H5Base()
Definition: Hdf5Util.h:96
g_hdf5Mutex
FIELD3D_NAMESPACE_OPEN FIELD3D_API boost::recursive_mutex g_hdf5Mutex
Definition: Hdf5Util.cpp:67
Hdf5Util::H5ScopedDget_space::open
void open(hid_t dataset_id)
Definition: Hdf5Util.h:398
GlobalLock
boost::recursive_mutex::scoped_lock GlobalLock
Definition: Hdf5Util.h:78
Hdf5Util::H5Base::m_id
hid_t m_id
Definition: Hdf5Util.h:106