Hdf5CustomWriter Class Reference

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

#include <Hdf5CustomWriter.h>

List of all members.

Public Member Functions

virtual ~Hdf5CustomWriter ()
virtual bool setDataToWrite (void *pObject)=0
virtual Hdf5TypeResource getWriteFileType () const =0
virtual Hdf5TypeResource getWriteMemoryType () const =0
virtual Hdf5DataSpaceResource createDataSpace () const =0
virtual const void * getWriteBuffer () const =0


Detailed Description

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

In addition to implementing this custom interface, a template specialization of createHdf5CustomWriter() 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 35 of file Hdf5CustomWriter.h.


Constructor & Destructor Documentation

virtual Hdf5CustomWriter::~Hdf5CustomWriter (  )  [virtual]

Destroys the writer object.

Definition at line 41 of file Hdf5CustomWriter.h.


Member Function Documentation

virtual bool Hdf5CustomWriter::setDataToWrite ( void *  pObject  )  [pure virtual]

Sets the data that should be written by this writer.

If the given data is not supported by this writer, false should be returned.

Parameters:
pObject The data to write. This data can safely be cast from void* to T* where T is the type used in template specialization of createHdf5CustomWriter() that returned this writer instance.
Returns:
Returns true if the data can be written by this writer, false otherwise.

virtual Hdf5TypeResource Hdf5CustomWriter::getWriteFileType (  )  const [pure virtual]

Return the HDF5 datatype, ie.

hid_t that represents the file type. This type will be provided as the file datatype to either a H5Acreate1() or H5Dcreate1() call in the HDF5 library depending on whether data is being written to an HDF5 attribute or an HDF5 dataset. The hid_t returned from this function will be properly closed by the Hdf5TypeResource object when the write operation is complete.

This method and getWriteMemoryType() are provided so that the types returned can vary. For example the file type could be packed and the memory type unpacked. Another example would be the file type could be big endian and the memory type little endian.

Returns:
Returns the HDF5 datatype that represents the file type of the data being written.

virtual Hdf5TypeResource Hdf5CustomWriter::getWriteMemoryType (  )  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 getWriteBuffer(). This type will be provided as the memory datatype to either a H5Awrite() or H5Dwrite() call in the HDF5 library depending on whether data is being written to an HDF5 attribute or an HDF5 dataset. The hid_t returned from this function will be properly closed by the Hdf5TypeResource object when the write operation is complete.

This method and getWriteFileType() are provided so that the types returned can vary. For example the file type could be packed and the memory type unpacked. Another example would be the file type could be big endian and the memory type little endian.

Returns:
Returns the HDF5 datatype that represents the in-memory type of the data being written.

virtual Hdf5DataSpaceResource Hdf5CustomWriter::createDataSpace (  )  const [pure virtual]

Returns the HDF5 dataspace that should be used in the H5Acreate1() or H5Dcreate1().

The dataspace returned should be compatible with the void* buffer that will be returned from getWriteBuffer(). The dataspace returned should also be compatible with the dimensions of the data that was provided to setDataToWrite(). The hid_t returned from this function will be properly closed by the Hdf5DataSpaceResource object when the write operation is complete.

Returns:
Returns the HDF5 dataspace that represents the data being written.

virtual const void* Hdf5CustomWriter::getWriteBuffer (  )  const [pure virtual]

Returns a buffer suitable to pass to the H5Awrite() or H5Dwrite() calls in the HDF5 library.

The size and layout of the buffer are dependent on the HDF5 datatype returned from getWriteMemoryType() and the dataspace returned from createDataSpace(). This pointer should be owned by the Hdf5CustomWriter and deleted in the destructor.

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


Software Development Kit - Opticks 4.9.0 Build 16218