hi,
i'm writing a "read_h5" to memory buffer. when i'm writing to h5,i use
the struct s1_t below. when i'm reading back that h5, since it's a compound
data type
writing to a h5 file(write_h5 part)
···
-----------------------
typedef struct s1_t {
int a;
float b;
double c;
}s1_t;
s1_t s1[LENGTH];
hid_t s1_tid;
s1_tid = H5Tcreate(H5T_COMPOUND,sizeof(s1_t)); // <<compound data
type
dataset =
H5Dcreate(file,DATASETNAME,s1_tid,space,H5P_DEFAULT,H5P_DEFAULT,H5P_DEFAULT);
reading h5 file(read_h5 part)
-----------------------------------
typedef struct s1_t {---}; s2_t ....... s100_t;
hid_t s1_tid;
s1_tid = H5Tcreate(H5T_COMPOUND,sizeof(s1_t)); // <<compound data type
//WHAT IF I HAVE 100 struct? i have to do H5Tcreate for each struct i have
and do "H5Tequal" for 100 times
hid_t ss_tid;
ss_tid = H5Dget_type(dataset);
if(H5Tequal(ss_tid,s1_tid)>0)
printf("equal datatype\n");
//any easy way to get the compound datatype of a dataset without comparing
with each struct we have?
thanks
winthan