1

I'm trying to store some data in HDF5 using the C++ API, with several requirements:

  1. an arbitrary number of entries can be stored,
  2. each entry has the same number of rows (of types int and double),
  3. the number and type of the rows should be determined at runtime.

I think the right way to implement this is as a packet table, but the example I've been able to find stores only one native type per entry. I'd like to store several, similar to a compound datatype but again the example I found isn't sufficient because it stores a struct, which can't be written at runtime. Are there some examples where this is done? Or just some high-level API that I missed?

Shep
  • 7,990
  • 8
  • 49
  • 71

1 Answers1

0

Are you still looking for an answer? I cannot make out what you are after exactly.

A packet table is a special form of dataset. The number of records in a packet table can be unbounded.

Since you mention that setting a size of struct at compile time for a compound datatype does not work for you, you might try to separate your data and correlate it in some way.

Arrays in isolation can be written to a dataset with their rank and size set at run time.

Data within an HDF file can be linked, either with your own method, or using HDF links. You can link the individual array data records together, along with the matching compound data, if any.

Hope that helps.