Field3D
Hdf5Util::H5ScopedDopen Class Reference

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

#include <Hdf5Util.h>

Inheritance diagram for Hdf5Util::H5ScopedDopen:
Hdf5Util::H5Base

Public Member Functions

 H5ScopedDopen ()
 
 H5ScopedDopen (hid_t parentLocation, const std::string &name, hid_t dapl_id)
 
void open (hid_t parentLocation, const std::string &name, hid_t dapl_id)
 
 ~H5ScopedDopen ()
 
- 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 325 of file Hdf5Util.h.

Constructor & Destructor Documentation

Hdf5Util::H5ScopedDopen::H5ScopedDopen ( )
inline

Definition at line 328 of file Hdf5Util.h.

329  : H5Base()
330  {
331  // Empty
332  }
Hdf5Util::H5ScopedDopen::H5ScopedDopen ( hid_t  parentLocation,
const std::string &  name,
hid_t  dapl_id 
)
inline

Definition at line 333 of file Hdf5Util.h.

References open().

334  {
335  open(parentLocation, name, dapl_id);
336  }
Hdf5Util::H5ScopedDopen::~H5ScopedDopen ( )
inline

Definition at line 341 of file Hdf5Util.h.

References Hdf5Util::H5Base::m_id.

342  {
343  if (m_id >= 0) {
344  H5Dclose(m_id);
345  }
346  }

Member Function Documentation

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

Definition at line 337 of file Hdf5Util.h.

References Hdf5Util::H5Base::m_id.

Referenced by H5ScopedDopen(), and SparseDataReader< Data_T >::SparseDataReader().

338  {
339  m_id = H5Dopen(parentLocation, name.c_str(), dapl_id);
340  }

The documentation for this class was generated from the following file: