If I were to use the C++/C API to write simple 1D vectors, like
std::vector<double> errors (100, 0);
What would be the simplest way to achieve this using the C/C++ API? When I try to use create_dataset_double, the conversion to const double* naturally fails.
Usually &(errors[0]) is used to get a pointer to the underlying vector storage (note that vector storage is guaranteed to be contiguous). In that way you can use the C API. However, this cannot be done for bool vectors before C++11 since they are represented as bits.
I am now having the same problem that I had with the C-API in terms of automatically creating nested groups.
The solution in the C API was to create the link creation property list, use
H5Pset_create_intermediate_group(lcpl_id,1);
and pass the lcpl_id the ID of the link creation property list to H5Fcreate.
In the C++ API, the constructor of the H5::File class does not take the link creation property list as an argument, and there seems to be no link creatio property list available as a class in the C++ API.
So if I have a parameter study that I model in my C++ simulation software with multiple nested for loops, I need to manually create each sub-group in order to create the next one using the official C++ API?
We added the link creation property list for C++ to HDF5-1.10.2, but unfortunately did not include the H5Pset_create_intermediate API. I added bug HDFFV-10622 for it to be added to the C++ APIs.