I want to write, in a single line, the elements: ObjectArray[i].Element
(0<=i<n) without having to copy the elements into a separate array altogether.
Using CompType and insertMember, I am writing just a subset (including Element)
of an array of a compound datatype ObjectArray (a class/object in my case).
H5::CompType mtype(sizeof(Class));
mtype.insertMember("MD", HOFFSET(Class, dMD), datatype);
H5::DataSet dataset = solution.createDataSet( "/Well", mtype, dataspace,
ds_creatplist );
dataset.write( ObjectArray, mtype );
This works fine. However, not unexpectedly, since I am defining the CompType
with the size of the whole class (Class), while writing out only a subset
(Element), my .h5 file is bigger (sizeof(Class)) than it should be
(sizeof(Element)). I am already using compression. Is there a way to 'delete'
this unused space? Or is there a better way to do what I'm trying to achieve?
Is using hyperslab the right answer?
Thanks
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5