21 #include "AbstractHdfProxy.h"
23 #include <unordered_map>
37 HdfProxy(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) :
AbstractHdfProxy(partialObject), hdfFile(-1), compressionLevel(0) {}
51 DLL_IMPORT_OR_EXPORT
bool isOpened() const final {
return hdfFile != -1; }
55 COMMON_NS::AbstractObject::hdfDatatypeEnum getHdfDatatypeInDataset(const std::
string& groupName) final;
57 int getHdfDatatypeClassInDataset(const std::
string& datasetName) final;
59 void writeItemizedListOfList(const std::
string& groupName,
60 const std::
string& name,
61 hdf5_hid_t cumulativeLengthDatatype,
62 const
void* cumulativeLength,
63 unsigned long long cumulativeLengthSize,
64 hdf5_hid_t elementsDatatype,
66 unsigned long long elementsSize) final;
68 unsigned int getDimensionCount(const std::
string& datasetName) final;
74 std::vector<
unsigned long long> getElementCountPerDimension(const std::
string & datasetName) final;
76 signed long long getElementCount(const std::
string& datasetName) final;
78 DLL_IMPORT_OR_EXPORT
void setCompressionLevel(
unsigned int newCompressionLevel) final {
79 compressionLevel = newCompressionLevel > 9 ? 9 : newCompressionLevel;
83 const std::string& name,
84 const float* floatValues,
85 const unsigned long long* numValuesInEachDimension,
86 unsigned int numDimensions)
final;
89 const std::string& name,
90 const double* dblValues,
91 const unsigned long long* numValuesInEachDimension,
92 unsigned int numDimensions)
final;
95 const std::string& name,
96 const char* intValues,
97 const unsigned long long* numValuesInEachDimension,
98 unsigned int numDimensions)
final;
101 const std::string& name,
102 const int* intValues,
103 const unsigned long long* numValuesInEachDimension,
104 unsigned int numDimensions)
final;
107 const std::string & name,
108 const int64_t * values,
109 const unsigned long long * numValuesInEachDimension,
110 unsigned int numDimensions)
final;
113 const std::string& name,
114 const uint64_t * values,
115 const unsigned long long* numValuesInEachDimension,
116 unsigned int numDimensions)
final;
119 const std::string& name,
122 const unsigned long long* numValuesInEachDimension,
123 unsigned int numDimensions)
final;
126 const std::string& groupName,
127 const std::string& name,
129 const unsigned long long* numValuesInEachDimension,
130 unsigned int numDimensions
134 const std::string& groupName,
135 const std::string& name,
138 const unsigned long long* numValuesInEachDimension,
139 const unsigned long long* offsetValuesInEachDimension,
140 unsigned int numDimensions
144 const std::vector<std::string>& attributeNames,
145 const std::vector<std::string>& values)
final;
148 const std::string& attributeName,
149 const std::vector<std::string>& values)
final;
152 const std::vector<std::string>& attributeNames,
153 const std::vector<double>& values)
final;
156 const std::vector<std::string>& attributeNames,
157 const std::vector<int>& values)
final;
160 const std::vector<std::string>& attributeNames,
161 const std::vector<std::string>& values)
final;
164 const std::string& attributeName,
165 const std::vector<std::string>& values)
final;
168 const std::vector<std::string>& attributeNames,
169 const std::vector<double>& values)
final;
172 const std::vector<std::string>& attributeNames,
173 const std::vector<int>& values)
final;
176 const std::string& attr_name)
const final;
179 const std::string& attr_name)
const final;
182 const std::string& attr_name)
const final;
185 const std::string& attr_name)
const final;
190 const std::string& datasetName,
192 unsigned long long const* numValuesInEachDimension,
193 unsigned long long const* offsetInEachDimension,
194 unsigned int numDimensions
198 const std::string& datasetName,
double* values,
199 unsigned long long const* blockCountPerDimension,
200 unsigned long long const* offsetInEachDimension,
201 unsigned long long const* strideInEachDimension,
202 unsigned long long const* blockSizeInEachDimension,
203 unsigned int numDimensions)
final;
206 const std::string& datasetName,
207 unsigned long long const* blockCountPerDimension,
208 unsigned long long const* offsetInEachDimension,
209 unsigned long long const* strideInEachDimension,
210 unsigned long long const* blockSizeInEachDimension,
211 unsigned int numDimensions,
214 hdf5_hid_t& filespace)
final;
218 hdf5_hid_t filespace,
220 unsigned long long slabSize)
final;
225 const std::string& datasetName,
227 unsigned long long const* numValuesInEachDimension,
228 unsigned long long const* offsetInEachDimension,
229 unsigned int numDimensions
235 const std::string& datasetName,
237 unsigned long long const* numValuesInEachDimension,
238 unsigned long long const* offsetInEachDimension,
239 unsigned int numDimensions)
final;
246 const std::string& datasetName,
248 unsigned long long const* numValuesInEachDimension,
249 unsigned long long const* offsetInEachDimension,
250 unsigned int numDimensions
265 bool exist(
const std::string& absolutePathInHdfFile)
const final;
276 HdfProxy(gsoap_resqml2_0_1::_eml20__EpcExternalPartReference* fromGsoap) :
277 AbstractHdfProxy(fromGsoap), hdfFile(-1), compressionLevel(0), openedGroups() {}
284 HdfProxy(gsoap_eml2_1::_eml21__EpcExternalPartReference* fromGsoap) :
285 AbstractHdfProxy(fromGsoap), hdfFile(-1), compressionLevel(0), openedGroups() {}
292 HdfProxy(gsoap_eml2_3::_eml23__EpcExternalPartReference* fromGsoap) :
293 AbstractHdfProxy(fromGsoap), hdfFile(-1), compressionLevel(0), openedGroups() {}
306 HdfProxy(
const std::string & packageDirAbsolutePath,
const std::string & externalFilePath, COMMON_NS::DataObjectRepository::openingMode hdfPermissionAccess = COMMON_NS::DataObjectRepository::openingMode::READ_ONLY);
317 void readArrayNdOfValues(
const std::string& datasetName,
void* values, hdf5_hid_t datatype);
337 void readArrayNdOfValues(
338 const std::string& datasetName,
340 unsigned long long const* numValuesInEachDimension,
341 unsigned long long const* offsetInEachDimension,
342 unsigned int numDimensions,
343 hdf5_hid_t datatype);
368 void readArrayNdOfValues(
369 const std::string& datasetName,
371 unsigned long long const* blockCountPerDimension,
372 unsigned long long const* offsetInEachDimension,
373 unsigned long long const* strideInEachDimension,
374 unsigned long long const* blockSizeInEachDimension,
375 unsigned int numDimensions,
376 hdf5_hid_t datatype);
391 void readArrayNdOfValues(
393 hdf5_hid_t filespace,
395 unsigned long long slabSize,
396 hdf5_hid_t datatype);
401 void writeUuidAttribute();
412 hdf5_hid_t openOrCreateGroup(
const std::string& groupName);
418 unsigned int compressionLevel;
421 std::unordered_map< std::string, hdf5_hid_t > openedGroups;
An abstract proxy for reading and writing values into an HDF5 file. It is possible to derive this cla...
Definition: AbstractHdfProxy.h:42
A proxy for reading and writing values into an HDF5 file.
Definition: HdfProxy.h:29
void writeArrayNd(const std::string &groupName, const std::string &name, hdf5_hid_t datatype, const void *values, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions) final
double readDoubleAttribute(const std::string &obj_name, const std::string &attr_name) const final
void readArrayNdOfDoubleValues(const std::string &datasetName, double *values) final
HdfProxy(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition: HdfProxy.h:37
void writeGroupAttributes(const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< int > &values) final
void readArrayNdOfDoubleValues(const std::string &datasetName, double *values, unsigned long long const *numValuesInEachDimension, unsigned long long const *offsetInEachDimension, unsigned int numDimensions) final
void writeDatasetAttribute(const std::string &datasetName, const std::string &attributeName, const std::vector< std::string > &values) final
void writeArrayNdOfIntValues(const std::string &groupName, const std::string &name, const int *intValues, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions) final
void readArrayNdOfUIntValues(const std::string &datasetName, unsigned int *values) final
void writeArrayNdOfCharValues(const std::string &groupName, const std::string &name, const char *intValues, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions) final
void readArrayNdOfInt64Values(const std::string &datasetName, int64_t *values) final
void writeArrayNdOfFloatValues(const std::string &groupName, const std::string &name, const float *floatValues, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions) final
void writeDatasetAttributes(const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< double > &values) final
void writeArrayNdSlab(const std::string &groupName, const std::string &name, hdf5_hid_t datatype, const void *values, const unsigned long long *numValuesInEachDimension, const unsigned long long *offsetValuesInEachDimension, unsigned int numDimensions) final
void writeGroupAttributes(const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< double > &values) final
void createArrayNd(const std::string &groupName, const std::string &name, hdf5_hid_t datatype, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions) final
void readArrayNdOfFloatValues(const std::string &datasetName, float *values, unsigned long long const *numValuesInEachDimension, unsigned long long const *offsetInEachDimension, unsigned int numDimensions) final
bool isOpened() const final
Definition: HdfProxy.h:51
std::string readStringAttribute(const std::string &obj_name, const std::string &attr_name) const final
void readArrayNdOfUInt64Values(const std::string &datasetName, uint64_t *values) final
int64_t readLongAttribute(const std::string &obj_name, const std::string &attr_name) const final
void readArrayNdOfInt64Values(const std::string &datasetName, int64_t *values, unsigned long long const *numValuesInEachDimension, unsigned long long const *offsetInEachDimension, unsigned int numDimensions) final
void writeArrayNdOfInt64Values(const std::string &groupName, const std::string &name, const int64_t *values, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions) final
virtual ~HdfProxy()
Definition: HdfProxy.h:47
std::vector< unsigned long long > readArrayDimensions(const std::string &datasetName) final
void readArrayNdOfCharValues(const std::string &datasetName, char *values) final
void readArrayNdOfFloatValues(const std::string &datasetName, float *values) final
void readArrayNdOfUShortValues(const std::string &datasetName, unsigned short *values) final
void selectArrayNdOfValues(const std::string &datasetName, unsigned long long const *blockCountPerDimension, unsigned long long const *offsetInEachDimension, unsigned long long const *strideInEachDimension, unsigned long long const *blockSizeInEachDimension, unsigned int numDimensions, bool newSelection, hdf5_hid_t &dataset, hdf5_hid_t &filespace) final
void writeArrayNdOfDoubleValues(const std::string &groupName, const std::string &name, const double *dblValues, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions) final
void readArrayNdOfDoubleValues(hdf5_hid_t dataset, hdf5_hid_t filespace, void *values, unsigned long long slabSize) final
void writeArrayNdOfUInt64Values(const std::string &groupName, const std::string &name, const uint64_t *values, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions) final
std::vector< std::string > readStringArrayAttribute(const std::string &obj_name, const std::string &attr_name) const final
bool exist(const std::string &absolutePathInHdfFile) const final
void readArrayNdOfIntValues(const std::string &datasetName, int *values) final
void readArrayNdOfDoubleValues(const std::string &datasetName, double *values, unsigned long long const *blockCountPerDimension, unsigned long long const *offsetInEachDimension, unsigned long long const *strideInEachDimension, unsigned long long const *blockSizeInEachDimension, unsigned int numDimensions) final
void readArrayNdOfShortValues(const std::string &datasetName, short *values) final
HdfProxy(const common::DataObjectReference &dor)
Constructor.
Definition: HdfProxy.h:44
void readArrayNdOfUCharValues(const std::string &datasetName, unsigned char *values) final
bool isCompressed(const std::string &datasetName) final
void writeGroupAttribute(const std::string &groupName, const std::string &attributeName, const std::vector< std::string > &values) final
void writeDatasetAttributes(const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values) final
void writeGroupAttributes(const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values) final
void readArrayNdOfIntValues(const std::string &datasetName, int *values, unsigned long long const *numValuesInEachDimension, unsigned long long const *offsetInEachDimension, unsigned int numDimensions) final
void writeDatasetAttributes(const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< int > &values) final