HDFGroup / vol-rest

HDF5 REST VOL Connector
Other
5 stars 8 forks source link

Fix external links for groups, dsets, dtypes #30

Closed mattjala closed 1 year ago

mattjala commented 1 year ago

Groups, datasets, and datatypes from an external file now correctly indicate this in their domain field upon being opened.

H5Oget_info_by_name now correctly retrieves external links' domain.

Fix for #24 , #30

ron-kuhn commented 1 year ago

Stinks that all object now will have their own copy of the domain. Too bad this isn't implemented in c++ so that you can use shared_ptr. Copying the domain's RV_object_t into new memory now pulls in the fapl and fcpl. If these were to be utilized somehow from the children, they have the potential to be corrupt after the the real domain file closes.

ron-kuhn commented 1 year ago

Could you add a reference count to the RV_file_t that increment the reference count when copied and RV_file_close will decrement the reference count and close the file resources when reference count is 0. You could use RV_file_close on the domain of all the objects.

ron-kuhn commented 1 year ago

@mattjala, nice use of reference counting for the domain. Pull request tested great. One problem is that MS VS doesn't allow adding to void*. rest-vol.c line 1270 had to be changed to:

memcpy(buffer, (const char*)uinfo->buffer + uinfo->bytes_sent, data_size);