#include <Hdf5Resource.h>

Public Member Functions | |
| Hdf5DataSetResource (hid_t fileHandle, const std::string &datasetName) | |
| Hdf5DataSetResource (hid_t dataset) | |
| Hdf5DataSetResource () | |
| operator hid_t * () | |
This is a Resource class that opens and closes HDF5 datasets. It has a conversion operator to allow a Hdf5DatasetResource object to be used where ever a hid_t that represents an open HDF5 dataset Handle may be used.
Example of Usage:
Hdf5FileResource pFile("c:/data/a.h5"); // open for read-only access if (pFile.get() != NULL && *pFile > 0) // file exists { Hdf5DatasetResource pDataset(*pFile, "/home/dataset/1"); if (pDataset != NULL && *pDataset > 0) { // do H5Dread here } }
Definition at line 330 of file Hdf5Resource.h.
| Hdf5DataSetResource::Hdf5DataSetResource | ( | hid_t | fileHandle, | |
| const std::string & | datasetName | |||
| ) |
Constructs a Resource object that wraps a hid_t HDF5 Dataset Handle.
Opens the specified dataset based on a file handle and the full path and name to the dataset within the file (ie. "/home/data/cube1"). Calls H5Dopen1().
| fileHandle | The HDF5 file handle. |
| datasetName | The full path and name to the HDF5 dataset to open. |
Definition at line 346 of file Hdf5Resource.h.
| Hdf5DataSetResource::Hdf5DataSetResource | ( | hid_t | dataset | ) |
Construct a Resource object that wraps a hid_t HDF5 Dataset Handle.
This will take ownership of an existing hid_t dataset handle and will ensure that it is closed.
| dataset | The HDF5 dataset handle. |
Definition at line 360 of file Hdf5Resource.h.
| Hdf5DataSetResource::Hdf5DataSetResource | ( | ) |
| Hdf5DataSetResource::operator hid_t * | ( | ) |
Returns a pointer to the underlying hid_t returned by H5Dopen1.
Returns a pointer to the underlying hid_t. This operator, used in conjunction with the dereferencing operator, allows the Hdf5DatasetResource object to be used where ever a hid_t would normally be used.
Definition at line 383 of file Hdf5Resource.h.