#include <Hdf5CustomReader.h>
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 |
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.
| virtual Hdf5CustomReader::~Hdf5CustomReader | ( | ) | [virtual] |
| 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.
| virtual unsigned int Hdf5CustomReader::getSupportedDimensionality | ( | ) | const [pure virtual] |
Returns the HDF5 dimensionality or rank supported by this Hdf5CustomReader interface.
| 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.
| 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.
| 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. |
| 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.
| 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.