Hdf5CustomReader Class Reference

This interface should be implemented to allow a custom type to be read by the HdfPlugInLib. More...

#include <Hdf5CustomReader.h>

List of all members.

Public Member Functions

virtual ~Hdf5CustomReader ()
virtual bool isValid () const =0
virtual unsigned int getSupportedDimensionality () const =0
virtual Hdf5TypeResource getReadMemoryType () const =0
virtual bool setReadDataSpace (const std::vector< hsize_t > &dataSpace)=0
virtual void * getReadBuffer () const =0
virtual void * getValue () const =0


Detailed Description

This interface should be implemented to allow a custom type to be read by the HdfPlugInLib.

In addition to implementing this custom interface, a template specialization of createHdf5CustomReader() needs to be created for the given type. This class has a highly defined calling order for the functions which is defined below:

Definition at line 44 of file Hdf5CustomReader.h.


Constructor & Destructor Documentation

virtual Hdf5CustomReader::~Hdf5CustomReader (  )  [virtual]

Destroys the reader object.

Definition at line 50 of file Hdf5CustomReader.h.


Member Function Documentation

virtual bool Hdf5CustomReader::isValid (  )  const [pure virtual]

Determines whether the reader is valid for the given HDF5 datatype provided to the createHdf5CustomReader() function.

If false is returned, this instance is immediately deleted and the read operation is stopped. If true is returned the read operation continues.

Returns:
Return false in your implementation if the given HDF5 datatype is NOT supported by this reader class, otherwise return true.

virtual unsigned int Hdf5CustomReader::getSupportedDimensionality (  )  const [pure virtual]

Returns the HDF5 dimensionality or rank supported by this Hdf5CustomReader interface.

Returns:
Returns the HDF5 dimensionality or rank supported by this Hdf5CustomReader.

virtual Hdf5TypeResource Hdf5CustomReader::getReadMemoryType (  )  const [pure virtual]

Return the HDF5 datatype, ie.

hid_t that represents the in-memory type. The type returned should be compatible with the void* buffer returned from getReadBuffer(). This type will be provided as the memory datatype to either a H5Aread() or H5Dread() call in the HDF5 library depending on whether data is being read from an HDF5 attribute or an HDF5 dataset. The hid_t returned from this function will be properly closed by the Hdf5TypeResource object when the read operation is complete.

Returns:
Returns the HDF5 datatype that represents the in-memory type. If appropriate you can simly return a H5Tcopy() of the type provided to createHdf5CustomReader().

virtual bool Hdf5CustomReader::setReadDataSpace ( const std::vector< hsize_t > &  dataSpace  )  [pure virtual]

Sets the dimensions of the data that will be read in from the given dataspace.

Parameters:
dataSpace The dimensions and size of each dimension for the data that will be read in. An empty vector indicates scalar data will be read in, ie. a single value.
Returns:
Return true if the provided dimensions are supported by this reader, false otherwise.

virtual void* Hdf5CustomReader::getReadBuffer (  )  const [pure virtual]

Returns a buffer suitable to pass to the H5Aread() or H5Dread() calls in the HDF5 library.

The type and layout of the buffer are dependent on the HDF5 datatype returned from getReadMemoryType(). The size of the buffer is dependent on the value provided to setReadDataSpace. This pointer should be owned by the Hdf5CustomReader and deleted in the destructor.

Returns:
Returns a buffer suitable to pass to the HDF5 library calls of H5Aread() or H5Dread().

virtual void* Hdf5CustomReader::getValue (  )  const [pure virtual]

Returns a pointer to data which can be safely cast to T*, where T is the template specialization of createHdf5CustomReader.

The returned data should NOT be owned by the Hdf5CustomReader and will be owned by the caller of this function. The T* returned should be populated from the data that was pushed into the getReadBuffer() by the H5Aread() or H5Dread() calls.

Returns:
Returns a pointer to data which can be safely cast to T* by the caller, where T is template specialization of createHdf5CustomReader().


Software Development Kit - Opticks 4.9.0 Build 16218