21 #include "../common/HdfProxyFactory.h"
23 #include "DataArrayBlockingSession.h"
27 class DLL_IMPORT_OR_EXPORT
EtpHdfProxy :
public EML2_NS::AbstractHdfProxy
30 std::shared_ptr<DataArrayBlockingSession> session;
31 unsigned int compressionLevel;
33 std::string getUri()
const;
41 EtpHdfProxy(COMMON_NS::DataObjectRepository * repo,
const std::string & guid,
const std::string & title,
const std::string & packageDirAbsolutePath,
const std::string & externalFilePath, COMMON_NS::DataObjectRepository::openingMode hdfPermissionAccess) :
42 EML2_NS::AbstractHdfProxy(packageDirAbsolutePath, externalFilePath, hdfPermissionAccess) {
43 initGsoapProxy(repo, guid, title, 20);
49 EtpHdfProxy(gsoap_resqml2_0_1::_eml20__EpcExternalPartReference* fromGsoap) :
50 EML2_NS::AbstractHdfProxy(fromGsoap), session(nullptr), compressionLevel(0) {}
52 EtpHdfProxy(gsoap_eml2_1::_eml21__EpcExternalPartReference* fromGsoap) :
53 EML2_NS::AbstractHdfProxy(fromGsoap), session(nullptr), compressionLevel(0) {}
58 EtpHdfProxy(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) :
59 EML2_NS::AbstractHdfProxy(partialObject), session(nullptr), compressionLevel(0) {}
61 EtpHdfProxy(
const COMMON_NS::DataObjectReference& dor) :
62 EML2_NS::AbstractHdfProxy(dor), session(nullptr), compressionLevel(0) {}
71 std::shared_ptr<DataArrayBlockingSession> getSession() {
return session; }
72 void setSession(boost::asio::io_context& ioc,
const std::string & host,
const std::string & port,
const std::string & target);
83 bool isOpened()
const {
return session !=
nullptr && !session->isWebSocketSessionClosed(); }
88 void close() { session->close(); }
114 const std::string & name,
115 hdf5_hid_t cumulativeLengthDatatype,
116 const void * cumulativeLength,
117 unsigned long long cumulativeLengthSize,
118 hdf5_hid_t elementsDatatype,
119 const void * elements,
120 unsigned long long elementsSize);
144 void setCompressionLevel(
unsigned int newCompressionLevel) {
if (newCompressionLevel > 9) compressionLevel = 9;
else compressionLevel = newCompressionLevel; }
147 const std::string & name,
148 const float * floatValues,
149 const unsigned long long * numValuesInEachDimension,
150 unsigned int numDimensions);
162 const std::string & name,
163 const double * dblValues,
164 const unsigned long long * numValuesInEachDimension,
165 unsigned int numDimensions);
177 const std::string & name,
178 const char * intValues,
179 const unsigned long long * numValuesInEachDimension,
180 unsigned int numDimensions);
192 const std::string & name,
193 const int * intValues,
194 const unsigned long long * numValuesInEachDimension,
195 unsigned int numDimensions);
198 const std::string & name,
199 const int64_t * values,
200 const unsigned long long * numValuesInEachDimension,
201 unsigned int numDimensions);
213 const std::string & name,
214 const uint64_t * values,
215 const unsigned long long * numValuesInEachDimension,
216 unsigned int numDimensions);
229 const std::string & name,
232 const unsigned long long * numValuesInEachDimension,
233 unsigned int numDimensions);
245 const std::string& groupName,
246 const std::string& name,
248 const unsigned long long* numValuesInEachDimension,
249 unsigned int numDimensions
263 const std::string& groupName,
264 const std::string& name,
267 const unsigned long long* numValuesInEachDimension,
268 const unsigned long long* offsetValuesInEachDimension,
269 unsigned int numDimensions
276 const std::vector<std::string> & attributeNames,
277 const std::vector<std::string> & values);
283 const std::string & attributeName,
284 const std::vector<std::string> & values);
290 const std::vector<std::string> & attributeNames,
291 const std::vector<double> & values);
297 const std::vector<std::string> & attributeNames,
298 const std::vector<int> & values);
304 const std::vector<std::string> & attributeNames,
305 const std::vector<std::string> & values);
311 const std::string & attributeName,
312 const std::vector<std::string> & values);
318 const std::vector<std::string> & attributeNames,
319 const std::vector<double> & values);
325 const std::vector<std::string> & attributeNames,
326 const std::vector<int> & values);
329 const std::string & attr_name)
const;
332 const std::string & attr_name)
const;
335 const std::string & attr_name)
const;
338 const std::string & attr_name)
const;
356 const std::string & datasetName,
358 unsigned long long const * numValuesInEachDimension,
359 unsigned long long const * offsetInEachDimension,
360 unsigned int numDimensions
374 const std::string & datasetName,
double* values,
375 unsigned long long const * blockCountPerDimension,
376 unsigned long long const * offsetInEachDimension,
377 unsigned long long const * strideInEachDimension,
378 unsigned long long const * blockSizeInEachDimension,
379 unsigned int numDimensions);
382 const std::string & datasetName,
383 unsigned long long const * blockCountPerDimension,
384 unsigned long long const * offsetInEachDimension,
385 unsigned long long const * strideInEachDimension,
386 unsigned long long const * blockSizeInEachDimension,
387 unsigned int numDimensions,
389 hdf5_hid_t & dataset,
390 hdf5_hid_t & filespace);
401 hdf5_hid_t filespace,
403 unsigned long long slabSize);
421 const std::string & datasetName,
423 unsigned long long const * numValuesInEachDimension,
424 unsigned long long const * offsetInEachDimension,
425 unsigned int numDimensions
444 const std::string & datasetName,
446 unsigned long long const * numValuesInEachDimension,
447 unsigned long long const * offsetInEachDimension,
448 unsigned int numDimensions
474 const std::string & datasetName,
476 unsigned long long const * numValuesInEachDimension,
477 unsigned long long const * offsetInEachDimension,
478 unsigned int numDimensions
525 bool exist(
const std::string & absolutePathInHdfFile)
const;
549 EML2_NS::AbstractHdfProxy*
make(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) {
552 EML2_NS::AbstractHdfProxy*
make(
const COMMON_NS::DataObjectReference& dor) {
559 EML2_NS::AbstractHdfProxy*
make(gsoap_resqml2_0_1::_eml20__EpcExternalPartReference* fromGsoap) {
563 EML2_NS::AbstractHdfProxy*
make(COMMON_NS::DataObjectRepository * repo,
const std::string & guid,
const std::string & title,
564 const std::string & packageDirAbsolutePath,
const std::string & externalFilePath,
565 COMMON_NS::DataObjectRepository::openingMode hdfPermissionAccess = COMMON_NS::DataObjectRepository::openingMode::READ_ONLY) {
566 return new EtpHdfProxy(repo, guid, title, packageDirAbsolutePath, externalFilePath, hdfPermissionAccess);
Definition: EtpHdfProxy.h:544
eml2::AbstractHdfProxy * make(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition: EtpHdfProxy.h:549
eml2::AbstractHdfProxy * make(const common::DataObjectReference &dor)
Creates an instance of HDF5 file proxy. Only to be used in partial transfer context.
Definition: EtpHdfProxy.h:552
eml2::AbstractHdfProxy * make(common::DataObjectRepository *repo, const std::string &guid, const std::string &title, const std::string &packageDirAbsolutePath, const std::string &externalFilePath, common::DataObjectRepository::openingMode hdfPermissionAccess=common::DataObjectRepository::openingMode::READ_ONLY)
Creates an instance of HDF5 file proxy for serialization purpose.
Definition: EtpHdfProxy.h:563
eml2::AbstractHdfProxy * make(gsoap_resqml2_0_1::_eml20__EpcExternalPartReference *fromGsoap)
Definition: EtpHdfProxy.h:559
Definition: EtpHdfProxy.h:28
int getHdfDatatypeClassInDataset(const std::string &datasetName)
void writeArrayNdOfFloatValues(const std::string &groupName, const std::string &name, const float *floatValues, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions)
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)
std::vector< std::string > readStringArrayAttribute(const std::string &obj_name, const std::string &attr_name) const
void writeItemizedListOfList(const std::string &groupName, const std::string &name, hdf5_hid_t cumulativeLengthDatatype, const void *cumulativeLength, unsigned long long cumulativeLengthSize, hdf5_hid_t elementsDatatype, const void *elements, unsigned long long elementsSize)
EtpHdfProxy(common::DataObjectRepository *repo, const std::string &guid, const std::string &title, const std::string &packageDirAbsolutePath, const std::string &externalFilePath, common::DataObjectRepository::openingMode hdfPermissionAccess)
Definition: EtpHdfProxy.h:41
std::vector< unsigned long long > getElementCountPerDimension(const std::string &datasetName)
void writeDatasetAttributes(const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< int > &values)
void setCompressionLevel(unsigned int newCompressionLevel)
Definition: EtpHdfProxy.h:144
void readArrayNdOfDoubleValues(const std::string &datasetName, double *values, unsigned long long const *numValuesInEachDimension, unsigned long long const *offsetInEachDimension, unsigned int numDimensions)
void readArrayNdOfInt64Values(const std::string &datasetName, int64_t *values, unsigned long long const *numValuesInEachDimension, unsigned long long const *offsetInEachDimension, unsigned int numDimensions)
void writeGroupAttributes(const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< double > &values)
void readArrayNdOfDoubleValues(const std::string &datasetName, double *values)
void writeDatasetAttribute(const std::string &datasetName, const std::string &attributeName, const std::vector< std::string > &values)
std::string readStringAttribute(const std::string &obj_name, const std::string &attr_name) const
void writeArrayNdOfCharValues(const std::string &groupName, const std::string &name, const char *intValues, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions)
void writeArrayNdOfIntValues(const std::string &groupName, const std::string &name, const int *intValues, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions)
void readArrayNdOfFloatValues(const std::string &datasetName, float *values, unsigned long long const *numValuesInEachDimension, unsigned long long const *offsetInEachDimension, unsigned int numDimensions)
void writeDatasetAttributes(const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values)
static const char * XML_NS
Definition: EtpHdfProxy.h:535
void writeGroupAttributes(const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< std::string > &values)
void writeDatasetAttributes(const std::string &datasetName, const std::vector< std::string > &attributeNames, const std::vector< double > &values)
void writeArrayNdOfUInt64Values(const std::string &groupName, const std::string &name, const uint64_t *values, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions)
void writeArrayNdOfDoubleValues(const std::string &groupName, const std::string &name, const double *dblValues, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions)
void readArrayNdOfIntValues(const std::string &datasetName, int *values, unsigned long long const *numValuesInEachDimension, unsigned long long const *offsetInEachDimension, unsigned int numDimensions)
void readArrayNdOfShortValues(const std::string &datasetName, short *values)
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)
void readArrayNdOfFloatValues(const std::string &datasetName, float *values)
std::string getXmlNamespace() const
Definition: EtpHdfProxy.h:540
signed long long getElementCount(const std::string &datasetName)
void readArrayNdOfInt64Values(const std::string &datasetName, int64_t *values)
void writeGroupAttributes(const std::string &groupName, const std::vector< std::string > &attributeNames, const std::vector< int > &values)
void readArrayNdOfIntValues(const std::string &datasetName, int *values)
unsigned int getDimensionCount(const std::string &datasetName)
void readArrayNdOfUInt64Values(const std::string &datasetName, uint64_t *values)
bool isCompressed(const std::string &datasetName)
void writeGroupAttribute(const std::string &groupName, const std::string &attributeName, const std::vector< std::string > &values)
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)
void writeArrayNdOfInt64Values(const std::string &groupName, const std::string &name, const int64_t *values, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions)
void readArrayNdOfUShortValues(const std::string &datasetName, unsigned short *values)
void close()
Definition: EtpHdfProxy.h:88
void createArrayNd(const std::string &groupName, const std::string &name, hdf5_hid_t datatype, const unsigned long long *numValuesInEachDimension, unsigned int numDimensions)
void readArrayNdOfUIntValues(const std::string &datasetName, unsigned int *values)
EtpHdfProxy(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition: EtpHdfProxy.h:58
bool isOpened() const
Definition: EtpHdfProxy.h:83
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)
bool exist(const std::string &absolutePathInHdfFile) const
std::vector< unsigned long long > readArrayDimensions(const std::string &datasetName)
common::AbstractObject::hdfDatatypeEnum getHdfDatatypeInDataset(const std::string &groupName)
void readArrayNdOfCharValues(const std::string &datasetName, char *values)
int64_t readLongAttribute(const std::string &obj_name, const std::string &attr_name) const
void readArrayNdOfUCharValues(const std::string &datasetName, unsigned char *values)
void readArrayNdOfDoubleValues(hdf5_hid_t dataset, hdf5_hid_t filespace, void *values, unsigned long long slabSize)
double readDoubleAttribute(const std::string &obj_name, const std::string &attr_name) const
EtpHdfProxy(gsoap_resqml2_0_1::_eml20__EpcExternalPartReference *fromGsoap)
Definition: EtpHdfProxy.h:49