Hello,
I am new to HDF5, but am interested in using this in my code.
I have been looking at a case where I would like to store a compound data
element that would serialise the following c-struct.
typedef struct dataEvent {
int numDetections;
float *detectionTimes;
} DATA_EVENT;
I looked at the example cmpvflt.c, which shows an example of a compound data
type with a vlen object, but this seems to use code like this:
dataTypeId = H5Tcreate(H5T_COMPOUND, sizeof(DATA_EVENT));
However, I cannot see how this is supposed to work; the sizeof(DATA_EVENT) is
platform (and compiler) dependent, indeed I have both 32 and 64 bit machines.
On a 64 bit machine, the pointer is 8 bytes, and on a 32 bit machine the
pointer is 4 bytes, so the sizeof() is different.
How does this affect the use of vlen types and the serialisation thereof? I
read the vlen chapter in the reference manual, but I could not see how this was
being addressed. Specifically, if I write a file on a 64 bit machine which
contains vlen entries, how can I safely read them on a 32 bit system? Does
HDF5 auto-magically sort this out somehow?
The number of entries in the vlen object is only quite small in my case,
typically 1 to 4.
Thanks.
_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org