Hdf5IncrementalReader Class Reference

This class provides the ability to incrementally read values from a HDF5 dataset without having to read the entire dataset into memory at once as Hdf5Dataset::readData() requires. More...

#include <Hdf5IncrementalReader.h>

List of all members.

Public Member Functions

 Hdf5IncrementalReader (hid_t dataSet)
virtual ~Hdf5IncrementalReader ()
bool selectHyperslab (H5S_seloper_t operation, const hsize_t *pStart, const hsize_t *pStride, const hsize_t *pCount, const hsize_t *pBlock)
bool selectElements (H5S_seloper_t operation, const size_t num_elements, const hsize_t *pCoord)
bool selectAll ()
bool selectNone ()
bool isSelectionValid () const
hid_t getDataSet () const
hid_t getSelectionDataSpace () const
hssize_t getNumberOfSelectedPoints () const
template<typename T>
T * readSelectedData () const

Protected Attributes

hid_t mDataset
hid_t mDataspace


Detailed Description

This class provides the ability to incrementally read values from a HDF5 dataset without having to read the entire dataset into memory at once as Hdf5Dataset::readData() requires.

Definition at line 27 of file Hdf5IncrementalReader.h.


Constructor & Destructor Documentation

Hdf5IncrementalReader::Hdf5IncrementalReader ( hid_t  dataSet  ) 

Construct an instance of this reader to read data from the provided HDF5 dataset.

Parameters:
dataSet A HDF5 dataset handle to an already open HDF5 dataset. This dataset handle will not be closed by the reader.

virtual Hdf5IncrementalReader::~Hdf5IncrementalReader (  )  [virtual]

Destroys the Hdf5IncrementalReader.

The HDF5 dataset handle provided in the constructor is NOT closed.


Member Function Documentation

bool Hdf5IncrementalReader::selectHyperslab ( H5S_seloper_t  operation,
const hsize_t *  pStart,
const hsize_t *  pStride,
const hsize_t *  pCount,
const hsize_t *  pBlock 
)

Selects points in the dataset that will be read when calling readSelecteData().

This method is a wrapper for H5Sselect_hyperslab(). Please reference the documentation in the HDF5 library for more details.

Parameters:
operation Please see H5Sselect_hyperslab() documentation.
pStart Please see H5Sselect_hyperslab() documentation.
pStride Please see H5Sselect_hyperslab() documentation.
pCount Please see H5Sselect_hyperslab() documentation.
pBlock Please see H5Sselect_hyperslab() documentation.
Returns:
Returns false if an invalid HDF5 dataset was provided or H5Sselect_hyperslab() returns a negative value.

bool Hdf5IncrementalReader::selectElements ( H5S_seloper_t  operation,
const size_t  num_elements,
const hsize_t *  pCoord 
)

Selects points in the dataset that will be read when calling readSelecteData().

This method is a wrapper for H5Sselect_elements(). Please reference the documentation in the HDF5 library for more details.

Parameters:
operation Please see H5Sselect_elements() documentation.
num_elements Please see H5Sselect_elements() documentation.
pCoord Please see H5Sselect_elements() documentation.
Returns:
Returns false if an invalid HDF5 dataset was provided or H5Sselect_elements() returns a negative value.

bool Hdf5IncrementalReader::selectAll (  ) 

Selects all points in the dataset, so that they will be read when calling readSelectedData().

This method is a wrapper for H5Sselect_all(). Please reference the documentation in the HDF5 library for more details.

Returns:
Returns false if an invalid HDF5 dataset was provided or H5Sselect_all() returns a negative value.

bool Hdf5IncrementalReader::selectNone (  ) 

Selects no points in the dataset, so that nothing will be read when calling readSelectedData().

This method is a wrapper for H5Sselect_none(). Please reference the documentation in the HDF5 library for more details.

Returns:
Returns false if an invalid HDF5 dataset was provided or H5Sselect_none() returns a negative value.

bool Hdf5IncrementalReader::isSelectionValid (  )  const

Returns true if the current selection is valid for the dataset.

This method is a wrapper for H5Sselect_valid().

Returns:
Returns false if an invalid HDF5 dataset was provided or H5Sselect_valid() returns a value of 0 or less.

hid_t Hdf5IncrementalReader::getDataSet (  )  const

Returns a handle to the HDF5 dataset that was provided in the constructor.

Returns:
Returns a handle to the HDF5 dataset being read this reader.

hid_t Hdf5IncrementalReader::getSelectionDataSpace (  )  const

Returns a handle to the HDF5 dataspace that will be used as the selection when reading data out of the HDF5 dataset.

Returns:
Returns a handle to the HDF5 dataspace that defines the selected data.

hssize_t Hdf5IncrementalReader::getNumberOfSelectedPoints (  )  const

Returns a count of the number of points that are selected in the HDF5 dataset for reading.

This method is a wrapper for H5Sget_select_npoints() using the dataspace handle returned from getSelectionDataSpace().

Returns:
Returns -1 if an invalid HDF5 dataset was provided, otherwise the return value of H5Sget_select_npoints().

template<typename T>
T* Hdf5IncrementalReader::readSelectedData (  )  const

Reads the selected data from the HDF dataset as the given type.

The caller of this function is responsible for deleting the returned memory.

Returns:
Returns the parsed value. If the data could not be parsed by the Hdf5CustomReader instance then NULL will be returned.

Definition at line 163 of file Hdf5IncrementalReader.h.


Member Data Documentation

Definition at line 197 of file Hdf5IncrementalReader.h.

Definition at line 198 of file Hdf5IncrementalReader.h.


Software Development Kit - Opticks 4.9.0 Build 16218