37 #include "AbstractHdf5Access.hpp"
41 #if H5_VERS_MAJOR>=1 && H5_VERS_MINOR>=8
43 htri_t dataset_status = H5Lexists(
mFileId, rDatasetName.c_str(), H5P_DEFAULT);
44 return (dataset_status>0);
51 hid_t dataset_id = H5Dopen(
mFileId, rDatasetName.c_str());
84 hid_t attribute_type = H5Aget_type(name_attribute_id);
87 char* string_array = (
char *)malloc(
sizeof(
char)*MAX_STRING_SIZE);
88 H5Aread( name_attribute_id, attribute_type, string_array);
89 std::string name_string(&string_array[0]);
92 H5Aread( unit_attribute_id, attribute_type, string_array);
93 std::string unit_string(&string_array[0]);
97 H5Tclose(attribute_type);
98 H5Aclose(name_attribute_id);
99 H5Aclose(unit_attribute_id);
115 const std::string& rBaseName,
116 const std::string& rDatasetName,
118 : mBaseName(rBaseName),
119 mDatasetName(rDatasetName),
120 mIsDataComplete(true),
121 mIsUnlimitedDimensionSet(false)
136 const std::string& rBaseName,
137 const std::string& rDatasetName)
138 : mBaseName(rBaseName),
139 mDatasetName(rDatasetName),
140 mDirectory(rDirectory),
141 mIsDataComplete(true),
142 mIsUnlimitedDimensionSet(false)
179 hsize_t max_objects_in_chunk_cache = 12799u;
180 hsize_t max_bytes_in_cache = 128u*1024u*1024u;
181 #if H5_VERS_MAJOR>=1 && H5_VERS_MINOR>=8 && H5_VERS_RELEASE>=3 // HDF5 1.8.3+
184 H5Pset_chunk_cache( dapl_id,
185 max_objects_in_chunk_cache ,
187 H5D_CHUNK_CACHE_W0_DEFAULT);
190 hid_t fapl_id = H5Fget_access_plist(
mFileId );
191 H5Pset_cache( fapl_id,
193 max_objects_in_chunk_cache,
std::string GetUnlimitedDimensionUnit()
std::string mUnlimitedDimensionName
void SetUnlimitedDatasetId()
std::string mUnlimitedDimensionUnit
hid_t mVariablesDatasetId
hid_t mUnlimitedDatasetId
bool DoesDatasetExist(const std::string &rDatasetName)
std::string GetUnlimitedDimensionName()
void SetMainDatasetRawChunkCache()
AbstractHdf5Access(const std::string &rDirectory, const std::string &rBaseName, const std::string &rDatasetName, bool makeAbsolute=true)
virtual ~AbstractHdf5Access()
std::vector< unsigned > mIncompleteNodeIndices
virtual void SetPath(const std::string &rPath, RelativeTo::Value relativeTo)
bool mIsUnlimitedDimensionSet
std::vector< unsigned > GetIncompleteNodeMap()