Hi,

I've read many examples from both H5TB high level API and low level API for compound HDF data type, but I didn't find a good solution for my special use case. All those examples have one problematic assumption: data structure (which means number of fields and their types and values) must be known a priori - that's the problem in my case, when I don't know this structure and I need to create a table HDF dataset not only row-by-row, but also field-by-field in the row.

I need your advice how to achieve what I want using a proper sequence of HDF API calls.

Let's say my final HDF table will look like this:
['a', 1, 3.14]
['b', 2, 2.11]
['c', 3, 1.89]

So we simply have a HDF table with 3 columns of types: char, int, float
and 3 rows with some values.

Creation of that table must be divided into some "steps".
After 1st "step" I should have a table:
['a']

After 2nd step:
['a', 1]

After 3rd step:
['a', 1, 3.14]

After 4th step:
['a', 1, 3.14]
['b', x, x]

where x after 4th step is undefined and can be some default values which will be overwritten in the next steps.

How to achieve that use case?

Is it possible to create a table by calling H5TBmake_table(), but having no fields and no records at the beginning and then just call H5TBinsert_field() in the next steps?

Is it possible to have "data" attribute of H5TBinsert_field() function a NULL value when we insert a new field to a table dataset with no records yet?

What about 4th step - can I create just a first column value for a new record in a table?

I know it's maybe a strange use case, but the problem is that I could have really huge structure model (a lot of columns and a lot of records) which should be stored in the HDF table dataset, so I need to avoid "collecting" required information (number of fields, their types, values) by initial iterating over whole structure. The second problem is that I have a vector of objects which need to be stored as HDF table (where table row is the given object and columns are its fields), but all examples I've seen just work on C struct.

I would appreciate any advice!

Regards,
Rafal


_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://lists.hdfgroup.org/mailman/listinfo/hdf-forum_lists.hdfgroup.org
Twitter: https://twitter.com/hdf5

Reply via email to