File writer and spot finding improvements

This commit is contained in:
2024-04-08 11:18:50 +02:00
parent 15d99c6162
commit c6d2b5eedf
72 changed files with 690 additions and 893 deletions
+3 -11
View File
@@ -397,13 +397,10 @@ HDF5Group::~HDF5Group() {
H5Gclose(id);
}
HDF5File::HDF5File(const std::string& filename, bool create, bool swmr) : HDF5Object() {
HDF5File::HDF5File(const std::string& filename) : HDF5Object() {
HDF5Fapl fapl;
if (create) {
fapl.SetVersionTo1p10orNewer();
id = H5Fcreate(filename.c_str(), H5F_ACC_TRUNC | (swmr ? H5F_ACC_SWMR_WRITE : 0), H5P_DEFAULT, fapl.GetID());
} else
id = H5Fopen(filename.c_str(), H5F_ACC_RDWR | (swmr ? H5F_ACC_SWMR_WRITE : 0), H5P_DEFAULT);
fapl.SetVersionTo1p10orNewer();
id = H5Fcreate(filename.c_str(), H5F_ACC_TRUNC, H5P_DEFAULT, fapl.GetID());
if (id < 0)
throw JFJochException(JFJochExceptionCategory::HDF5, "Cannot open/create data HDF5 file " + filename);
}
@@ -416,11 +413,6 @@ void HDF5File::Delete(const std::string& path) {
H5Ldelete(id, path.c_str(), H5P_DEFAULT);
}
void HDF5File::StartSWMR() {
if (H5Fstart_swmr_write(id) < 0)
throw JFJochException(JFJochExceptionCategory::HDF5, "Cannot start SWMR mode");
}
HDF5ReadOnlyFile::HDF5ReadOnlyFile(const std::string &filename) {
id = H5Fopen(filename.c_str(), H5F_ACC_RDONLY, H5P_DEFAULT);
if (id < 0)