21#include "EpcExternalPartReference.h"
22#include "../common/HidtType.h"
41 static constexpr char const* CUMULATIVE_LENGTH_DS_NAME =
"cumulativeLength";
43 static constexpr char const* ELEMENTS_DS_NAME =
"elements";
53 DLL_IMPORT_OR_EXPORT
void setRootPath(
const std::string& rootPath) { packageDirectoryAbsolutePath = rootPath; }
61 DLL_IMPORT_OR_EXPORT
void setRelativePath(
const std::string& relPath) { relativeFilePath = relPath; }
68 DLL_IMPORT_OR_EXPORT
void setOpeningMode(COMMON_NS::DataObjectRepository::openingMode openingMode_) { openingMode = openingMode_; }
76 DLL_IMPORT_OR_EXPORT
const std::string&
getRelativePath()
const {
return relativeFilePath; }
89 DLL_IMPORT_OR_EXPORT
virtual bool isOpened()
const = 0;
92 DLL_IMPORT_OR_EXPORT
virtual void close() = 0;
101 DLL_IMPORT_OR_EXPORT
virtual COMMON_NS::AbstractObject::numericalDatatypeEnum
getNumericalDatatype(
const std::string & datasetName) = 0;
132 const std::string & name,
133 COMMON_NS::AbstractObject::numericalDatatypeEnum cumulativeLengthDatatype,
134 const void * cumulativeLength,
135 uint64_t cumulativeLengthSize,
136 COMMON_NS::AbstractObject::numericalDatatypeEnum elementsDatatype,
137 const void * elements,
138 uint64_t elementsSize) = 0;
149 DLL_IMPORT_OR_EXPORT uint64_t
getDimensionCount(
const std::string & datasetName) {
return getElementCountPerDimension(datasetName).size(); }
192 const std::string & name,
193 const float * values,
194 const uint64_t * numValuesInEachDimension,
195 unsigned int numDimensions) {
196 writeArrayNd(groupName, name, COMMON_NS::AbstractObject::numericalDatatypeEnum::FLOAT, values, numValuesInEachDimension, numDimensions);
214 const std::string & name,
215 const double * values,
216 const uint64_t * numValuesInEachDimension,
217 unsigned int numDimensions) {
218 writeArrayNd(groupName, name, COMMON_NS::AbstractObject::numericalDatatypeEnum::DOUBLE, values, numValuesInEachDimension, numDimensions);
236 const std::string & name,
237 const int8_t * values,
238 const uint64_t * numValuesInEachDimension,
239 unsigned int numDimensions) {
240 writeArrayNd(groupName, name, COMMON_NS::AbstractObject::numericalDatatypeEnum::INT8, values, numValuesInEachDimension, numDimensions);
258 const std::string & name,
260 const uint64_t * numValuesInEachDimension,
261 unsigned int numDimensions) {
262 writeArrayNd(groupName, name, COMMON_NS::AbstractObject::numericalDatatypeEnum::INT32, values, numValuesInEachDimension, numDimensions);
281 const std::string & name,
282 const int64_t * values,
283 const uint64_t * numValuesInEachDimension,
284 unsigned int numDimensions) {
285 writeArrayNd(groupName, name, COMMON_NS::AbstractObject::numericalDatatypeEnum::INT64, values, numValuesInEachDimension, numDimensions);
304 const std::string & name,
305 const uint64_t * values,
306 const uint64_t * numValuesInEachDimension,
307 unsigned int numDimensions) {
308 writeArrayNd(groupName, name, COMMON_NS::AbstractObject::numericalDatatypeEnum::UINT64, values, numValuesInEachDimension, numDimensions);
326 DLL_IMPORT_OR_EXPORT
virtual void writeArrayNd(
const std::string & groupName,
327 const std::string & name,
328 COMMON_NS::AbstractObject::numericalDatatypeEnum datatype,
330 const uint64_t * numValuesInEachDimension,
331 unsigned int numDimensions) = 0;
348 const std::string& groupName,
349 const std::string& name,
350 COMMON_NS::AbstractObject::numericalDatatypeEnum datatype,
351 const uint64_t* numValuesInEachDimension,
352 unsigned int numDimensions
371 const std::string& groupName,
372 const std::string& name,
373 COMMON_NS::AbstractObject::numericalDatatypeEnum datatype,
375 const uint64_t* numValuesInEachDimension,
376 const uint64_t* offsetValuesInEachDimension,
377 unsigned int numDimensions
391 const std::vector<std::string> & attributeNames,
392 const std::vector<std::string> & values) = 0;
402 const std::string & attributeName,
403 const std::vector<std::string> & values) = 0;
416 const std::vector<std::string> & attributeNames,
417 const std::vector<double> & values) = 0;
430 const std::vector<std::string> & attributeNames,
431 const std::vector<int> & values) = 0;
444 const std::vector<std::string> & attributeNames,
445 const std::vector<std::string> & values) = 0;
455 const std::string & attributeName,
456 const std::vector<std::string> & values) = 0;
469 const std::vector<std::string> & attributeNames,
470 const std::vector<double> & values) = 0;
483 const std::vector<std::string> & attributeNames,
484 const std::vector<int> & values) = 0;
499 const std::string & attr_name)
const = 0;
514 const std::string & attr_name)
const = 0;
529 const std::string & attr_name)
const = 0;
544 const std::string & attr_name)
const = 0;
576 const std::string & datasetName,
578 uint64_t
const * numValuesInEachDimension,
579 uint64_t
const * offsetInEachDimension,
580 unsigned int numDimensions
607 const std::string & datasetName,
609 uint64_t
const * blockCountPerDimension,
610 uint64_t
const * offsetInEachDimension,
611 uint64_t
const * strideInEachDimension,
612 uint64_t
const * blockSizeInEachDimension,
613 unsigned int numDimensions) = 0;
646 const std::string & datasetName,
647 uint64_t
const* blockCountPerDimension,
648 uint64_t
const* offsetInEachDimension,
649 uint64_t
const* strideInEachDimension,
650 uint64_t
const* blockSizeInEachDimension,
651 unsigned int numDimensions,
653 hdf5_hid_t & dataset,
654 hdf5_hid_t & filespace) = 0;
670 hdf5_hid_t filespace,
672 uint64_t slabSize) = 0;
704 const std::string & datasetName,
706 uint64_t
const * numValuesInEachDimension,
707 uint64_t
const * offsetInEachDimension,
708 unsigned int numDimensions
741 const std::string & datasetName,
743 uint64_t
const * numValuesInEachDimension,
744 uint64_t
const * offsetInEachDimension,
745 unsigned int numDimensions) = 0;
789 const std::string & datasetName,
791 uint64_t
const * numValuesInEachDimension,
792 uint64_t
const * offsetInEachDimension,
793 unsigned int numDimensions
860 DLL_IMPORT_OR_EXPORT
virtual bool exist(
const std::string & absolutePathInHdfFile)
const = 0;
871 DLL_IMPORT_OR_EXPORT
virtual bool isCompressed(
const std::string & datasetName) = 0;
885 DLL_IMPORT_OR_EXPORT
void setMaxChunkSize(
unsigned int newMaxChunkSize) { maxChunkSize = newMaxChunkSize; }
905 DLL_IMPORT_OR_EXPORT
void initGsoapProxy(COMMON_NS::DataObjectRepository* repo,
const std::string& guid,
const std::string& title,
unsigned int emlVersion);
907 static constexpr char const* MIME_TYPE =
"application/x-hdf5";
927 DLL_IMPORT_OR_EXPORT AbstractHdfProxy(
const std::string & packageDirAbsolutePath,
const std::string & externalFilePath, COMMON_NS::DataObjectRepository::openingMode hdfPermissionAccess = COMMON_NS::DataObjectRepository::openingMode::READ_ONLY) :
928 packageDirectoryAbsolutePath(packageDirAbsolutePath), relativeFilePath(externalFilePath), openingMode(hdfPermissionAccess) {}
935 AbstractHdfProxy(gsoap_resqml2_0_1::_eml20__EpcExternalPartReference* fromGsoap) :
936 EpcExternalPartReference(fromGsoap) {}
939 std::string packageDirectoryAbsolutePath;
941 std::string relativeFilePath;
943 COMMON_NS::DataObjectRepository::openingMode openingMode = COMMON_NS::DataObjectRepository::openingMode::READ_ONLY;
947 unsigned int maxChunkSize = 1000000;
An abstract proxy for reading and writing values into an HDF5 file. It is possible to derive this cla...
Definition AbstractHdfProxy.h:37
virtual void writeDatasetAttributes(const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values)=0
virtual void writeGroupAttributes(const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< double > &values)=0
virtual bool isOpened() const =0
virtual void readArrayNdOfInt64Values(const std::string &datasetName, int64_t *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions)=0
virtual void readArrayNdOfIntValues(const std::string &datasetName, int *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions)=0
virtual void writeItemizedListOfList(const std::string &groupName, const std::string &name, common::AbstractObject::numericalDatatypeEnum cumulativeLengthDatatype, const void *cumulativeLength, uint64_t cumulativeLengthSize, common::AbstractObject::numericalDatatypeEnum elementsDatatype, const void *elements, uint64_t elementsSize)=0
virtual int64_t readInt64Attribute(const std::string &obj_name, const std::string &attr_name) const =0
virtual double readDoubleAttribute(const std::string &obj_name, const std::string &attr_name) const =0
virtual void writeArrayNdSlab(const std::string &groupName, const std::string &name, common::AbstractObject::numericalDatatypeEnum datatype, const void *values, const uint64_t *numValuesInEachDimension, const uint64_t *offsetValuesInEachDimension, unsigned int numDimensions)=0
virtual std::vector< uint32_t > getElementCountPerDimension(const std::string &datasetName)=0
virtual void readArrayNdOfInt64Values(const std::string &datasetName, int64_t *values)=0
uint64_t getDimensionCount(const std::string &datasetName)
Definition AbstractHdfProxy.h:149
virtual common::AbstractObject::numericalDatatypeEnum getNumericalDatatype(const std::string &datasetName)=0
virtual void readArrayNdOfDoubleValues(const std::string &datasetName, double *values, uint64_t const *blockCountPerDimension, uint64_t const *offsetInEachDimension, uint64_t const *strideInEachDimension, uint64_t const *blockSizeInEachDimension, unsigned int numDimensions)=0
virtual void readArrayNdOfUShortValues(const std::string &datasetName, unsigned short *values)=0
virtual void readArrayNdOfFloatValues(const std::string &datasetName, float *values)=0
virtual void readArrayNdOfDoubleValues(const std::string &datasetName, double *values)=0
virtual void readArrayNdOfUInt64Values(const std::string &datasetName, uint64_t *values)=0
void writeArrayNdOfInt8Values(const std::string &groupName, const std::string &name, const int8_t *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
Definition AbstractHdfProxy.h:235
virtual void writeGroupAttribute(const std::string &groupName, const std::string &attributeName, const std::vector< std::string > &values)=0
virtual void readArrayNdOfIntValues(const std::string &datasetName, int *values)=0
virtual std::vector< std::string > readStringArrayAttribute(const std::string &obj_name, const std::string &attr_name) const =0
virtual void selectArrayNdOfValues(const std::string &datasetName, uint64_t const *blockCountPerDimension, uint64_t const *offsetInEachDimension, uint64_t const *strideInEachDimension, uint64_t const *blockSizeInEachDimension, unsigned int numDimensions, bool newSelection, hdf5_hid_t &dataset, hdf5_hid_t &filespace)=0
virtual void writeDatasetAttribute(const std::string &datasetName, const std::string &attributeName, const std::vector< std::string > &values)=0
virtual void readArrayNdOfUInt8Values(const std::string &datasetName, uint8_t *values)=0
virtual void readArrayNdOfShortValues(const std::string &datasetName, short *values)=0
virtual ~AbstractHdfProxy()=default
virtual void readArrayNdOfDoubleValues(hdf5_hid_t dataset, hdf5_hid_t filespace, void *values, uint64_t slabSize)=0
virtual std::vector< uint32_t > getElementCountPerChunkDimension(const std::string &datasetName)=0
virtual void writeGroupAttributes(const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< int > &values)=0
virtual bool exist(const std::string &absolutePathInHdfFile) const =0
void writeArrayNdOfInt64Values(const std::string &groupName, const std::string &name, const int64_t *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
Definition AbstractHdfProxy.h:280
virtual int getHdfDatatypeClassInDataset(const std::string &datasetName)=0
virtual void readArrayNdOfFloatValues(const std::string &datasetName, float *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions)=0
virtual void writeDatasetAttributes(const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< double > &values)=0
virtual bool isCompressed(const std::string &datasetName)=0
virtual void readArrayNdOfDoubleValues(const std::string &datasetName, double *values, uint64_t const *numValuesInEachDimension, uint64_t const *offsetInEachDimension, unsigned int numDimensions)=0
void writeArrayNdOfUInt64Values(const std::string &groupName, const std::string &name, const uint64_t *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
Definition AbstractHdfProxy.h:303
virtual void setCompressionLevel(unsigned int newCompressionLevel)=0
void setOpeningMode(common::DataObjectRepository::openingMode openingMode_)
Definition AbstractHdfProxy.h:68
virtual void createArrayNd(const std::string &groupName, const std::string &name, common::AbstractObject::numericalDatatypeEnum datatype, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)=0
void writeArrayNdOfFloatValues(const std::string &groupName, const std::string &name, const float *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
Definition AbstractHdfProxy.h:191
uint64_t getElementCount(const std::string &datasetName)
virtual void writeDatasetAttributes(const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< int > &values)=0
void writeArrayNdOfDoubleValues(const std::string &groupName, const std::string &name, const double *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
Definition AbstractHdfProxy.h:213
virtual void writeArrayNd(const std::string &groupName, const std::string &name, common::AbstractObject::numericalDatatypeEnum datatype, const void *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)=0
const std::string & getRelativePath() const
Definition AbstractHdfProxy.h:76
void setRelativePath(const std::string &relPath)
Definition AbstractHdfProxy.h:61
virtual void readArrayNdOfInt8Values(const std::string &datasetName, int8_t *values)=0
void writeArrayNdOfIntValues(const std::string &groupName, const std::string &name, const int *values, const uint64_t *numValuesInEachDimension, unsigned int numDimensions)
Definition AbstractHdfProxy.h:257
virtual void readArrayNdOfUIntValues(const std::string &datasetName, unsigned int *values)=0
virtual std::string readStringAttribute(const std::string &obj_name, const std::string &attr_name) const =0
virtual void writeGroupAttributes(const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values)=0
void setRootPath(const std::string &rootPath)
Definition AbstractHdfProxy.h:53
void setMaxChunkSize(unsigned int newMaxChunkSize)
Definition AbstractHdfProxy.h:885
void initGsoapProxy(common::DataObjectRepository *repo, const std::string &guid, const std::string &title, unsigned int emlVersion)
Proxy class for handling external parts of an EPC package. It must be used at least for external HDF5...
Definition EpcExternalPartReference.h:30