Josiah, great questions. Compound datatypes make sense for dense data and may not be the right vehicle to approach a sparse situation. (How sparse is your data?)
> 1) The message structure I'm dealing with is discovered at runtime, > while the example code uses structs that are defined at compile time. > Is there a common idiom for specifying compound datatypes dynamically? Nothing prevents you from doing an H5Tcreate(H5T_COMPOUND, size) at runtime and then add the appropriate members dynamically (via H5Tinsert). You might write some kind of type information parse, e.g., based on a JSON or XML representation. Remember though that all elements in a dataset (or attribute) must be of the same type. (Unless you make things totally opaque and loose all visibility...) > 2). The documentation indicates that datatype members can't be variable length? > Are there common workarounds (e.g. allocating the max that a member might need)? Where did you read that? You can have VLEN (sequence) or variable-length string members, no problem there. How efficient that can be is another story. (There's no support for compression, if you have VLENs & Co in the mix.) > 3) The documentation mentions that members can be small arrays - how small is small? Small or big arrays. As small as an array where each element is just one byte. For fixed-size arrays, have a look at the H5T_ARRAY class (up to 32 dimensions). Best, G. _______________________________________________ Hdf-forum is for HDF software users discussion. [email protected] http://mail.lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
