Hdf5DataSetResource Class Reference

This is a Resource class that opens and closes HDF5 datasets. More...

#include <Hdf5Resource.h>

Inheritance diagram for Hdf5DataSetResource:

Inheritance graph

List of all members.

Public Member Functions

 Hdf5DataSetResource (hid_t fileHandle, const std::string &datasetName)
 Hdf5DataSetResource (hid_t dataset)
 Hdf5DataSetResource ()
 operator hid_t * ()


Detailed Description

This is a Resource class that opens and closes HDF5 datasets.

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.


Constructor & Destructor Documentation

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().

Parameters:
fileHandle The HDF5 file handle.
See also:
Hdf5FileResource::get().
Parameters:
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.

Parameters:
dataset The HDF5 dataset handle.

Definition at line 360 of file Hdf5Resource.h.

Hdf5DataSetResource::Hdf5DataSetResource (  ) 

Default constructor.

Definition at line 368 of file Hdf5Resource.h.


Member Function Documentation

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.

Returns:
A pointer to the underlying hid_t returned by H5Dopen1.

Definition at line 383 of file Hdf5Resource.h.


Software Development Kit - Opticks 4.9.0 Build 16218