Nested composite data types in HDF5

I am part of a team working on a C ++ application that processes various types of messages and displays them in various formats. For the purposes of this discussion, a message can be thought of as a collection of name-value pairs. Values ​​are usually numeric, but can be strings. The message structure is mainly detected as it is processed. Messages can be arbitrarily large, so storing the view in memory is not allowed. The message is processed one name-value pair at a time. Messages can have an internal structure that is fixed by names in name-value pairs. A good analogy is to think of file names in a directory hierarchy.

I am working on a subsystem that processes these messages and uses the low-level HDF5 API to generate HDF output. Due to the limitations described above, the approach I use involves two passes over the message. In the first pass, I collect layout information and build a composite data type and data set. Then I make a second pass over the message to record the values. Since I write one value at a time , I have this sequence:


 // name, value, dataType, dtSize, ctDataSet and ctSpace have been defined elsewhere 
hid_t valueDT = H5Tcreate(H5T_COMPOUND, dtSize);
herr_t status = H5Tinsert(valueDT, name, 0, dataType);
hid_t filespace = H5Dget_space(ctDataSet);
hsize_t offset[] = { 0 };
hsize_t dim[] = [ 1 };
status = H5Sselect_hyperslab(filespace, H5S_SELECT_SET, offset, NULL,
                                             dim, NULL);
status = H5Dwrite(ctDataSet, valueDT, ctSpace, filespace, H5P_DEFAULT, &value);

, , . , . , , , , HDF5 . , , . , x . position.x.

, , . .

+4
2

HDF5 , . , , .

- , , HDF5 Common Lisp. , , - ( ), , C-, memoization ( ).

: , ( ):

Type = {
    x of Xtype;
    y of Ytype;
}

,

  • HDF5 Xtype ( )
  • HDF5 Ytype ( )
  • HDF5 , HDF5 Xtype Ytype.

, , , .

,

  • .
  • () HDF5
  • HDF5 HDF5.

()

.

/ . , , C/++, , , , . , , ++, , .

, , , , . , :

, C/++.

, , , , . , HDF5.

.

Type = {
    x of Xtype;
    y of Ytype;
}

  • Type , Xtype Ytype, .

  • Type .

  • , Type. , Xtype , Xtype, - , ..

  • . , Xtype Ytype .

, ( , ) , x y .

/ , / .

0

, , . , , , dataset > . , . , , , , , .

, " " , " ", . , - , API, . . MATLAB . MATLAB HDF5 - h5read(). h5read() , dataset, . , . - ?

0

All Articles