One option is to use composite types and explicitly map structural elements down to the basic types supported by HDF.
The only complication I found with the approach was with lists and sequences. One option is to store list items in a different dataset, and then reference the start and end index.
In cases where the data is not contiguous or more complex, one approach is to use the construction of a linked list type. So for the following:
class A { int i; vector<int> b; }
This maps to:
ADataset => { i, b_index }; BDataset => { value, next_index };
Entries in 'ADataset' store 'b_index'. Each entry in "BDataset" contains a value for that entry, followed by the optional next_index. For "next_index" you can find out the value of the checksum to find out when to stop.
source share