Fesapi  0.13.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
AbstractHdfProxy.h
1 /*-----------------------------------------------------------------------
2 Licensed to the Apache Software Foundation (ASF) under one
3 or more contributor license agreements. See the NOTICE file
4 distributed with this work for additional information
5 regarding copyright ownership. The ASF licenses this file
6 to you under the Apache License, Version 2.0 (the
7 "License"; you may not use this file except in compliance
8 with the License. You may obtain a copy of the License at
9 
10  http://www.apache.org/licenses/LICENSE-2.0
11 
12 Unless required by applicable law or agreed to in writing,
13 software distributed under the License is distributed on an
14 "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15 KIND, either express or implied. See the License for the
16 specific language governing permissions and limitations
17 under the License.
18 -----------------------------------------------------------------------*/
19 #pragma once
20 
21 #include "common/EpcExternalPartReference.h"
22 #include "resqml2/AbstractRepresentation.h"
23 #include "prodml2_0/DasAcquisition.h"
24 
25 #define CUMULATIVE_LENGTH_DS_NAME "cumulativeLength"
26 #define ELEMENTS_DS_NAME "elements"
27 
28 namespace COMMON_NS
29 {
30  class DLL_IMPORT_OR_EXPORT AbstractHdfProxy : public EpcExternalPartReference
31  {
32  protected:
33 
37  AbstractHdfProxy(const std::string & packageDirAbsolutePath, const std::string & externalFilePath);
38 
39  AbstractHdfProxy(gsoap_resqml2_0_1::_eml20__EpcExternalPartReference* fromGsoap, const std::string & packageDirAbsolutePath, const std::string & externalFilePath) :
40  EpcExternalPartReference(fromGsoap, packageDirAbsolutePath, externalFilePath) {}
41 
42  AbstractHdfProxy(gsoap_eml2_1::_eml21__EpcExternalPartReference* fromGsoap, const std::string & packageDirAbsolutePath, const std::string & externalFilePath) :
43  EpcExternalPartReference(fromGsoap, packageDirAbsolutePath, externalFilePath) {}
44 
49  void initGsoapProxy(soap* soapContext, const std::string & guid, const std::string & title, const EmlVersion & emlVersion);
50 
51  public:
52  virtual ~AbstractHdfProxy() {}
53 
58  virtual void open() = 0;
59 
63  virtual bool isOpened() const = 0;
64 
68  virtual void close() = 0;
69 
74  virtual int getHdfDatatypeInDataset(const std::string & datasetName) const = 0;
75 
80  virtual int getHdfDatatypeClassInDataset(const std::string & datasetName) const = 0;
81 
94  virtual void writeItemizedListOfList(const std::string & groupName,
95  const std::string & name,
96  const int & cumulativeLengthDatatype,
97  void * cumulativeLength,
98  const unsigned long long & cumulativeLengthSize,
99  const int & elementsDatatype,
100  void * elements,
101  const unsigned long long & elementsSize) = 0;
102 
107  virtual unsigned int getDimensionCount(const std::string & datasetName) = 0;
108 
113  virtual signed long long getElementCount(const std::string & datasetName) = 0;
114 
119  virtual void setCompressionLevel(const unsigned int & newCompressionLevel) = 0;
120 
121  virtual void writeArrayNdOfFloatValues(const std::string & groupName,
122  const std::string & name,
123  float * floatValues,
124  unsigned long long * numValuesInEachDimension,
125  const unsigned int & numDimensions) = 0;
126 
136  virtual void writeArrayNdOfDoubleValues(const std::string & groupName,
137  const std::string & name,
138  double * dblValues,
139  unsigned long long * numValuesInEachDimension,
140  const unsigned int & numDimensions) = 0;
141 
151  virtual void writeArrayNdOfCharValues(const std::string & groupName,
152  const std::string & name,
153  char * intValues,
154  unsigned long long * numValuesInEachDimension,
155  const unsigned int & numDimensions) = 0;
156 
166  virtual void writeArrayNdOfIntValues(const std::string & groupName,
167  const std::string & name,
168  int * intValues,
169  unsigned long long * numValuesInEachDimension,
170  const unsigned int & numDimensions) = 0;
171 
181  virtual void writeArrayNdOfGSoapULong64Values(const std::string & groupName,
182  const std::string & name,
183  ULONG64 * ulong64Values,
184  unsigned long long * numValuesInEachDimension,
185  const unsigned int & numDimensions) = 0;
186 
197  virtual void writeArrayNd(const std::string & groupName,
198  const std::string & name,
199  const int & datatype,
200  void * values,
201  unsigned long long * numValuesInEachDimension,
202  const unsigned int & numDimensions) = 0;
203 
213  virtual void createArrayNd(
214  const std::string& groupName,
215  const std::string& name,
216  const int & datatype,
217  unsigned long long* numValuesInEachDimension,
218  const unsigned int& numDimensions
219  ) = 0;
220 
230  virtual void writeArrayNdSlab(
231  const std::string& groupName,
232  const std::string& name,
233  const int & datatype,
234  void* values,
235  unsigned long long* numValuesInEachDimension,
236  unsigned long long* offsetValuesInEachDimension,
237  const unsigned int& numDimensions
238  ) = 0;
239 
243  virtual void writeGroupAttributes(const std::string & groupName,
244  const std::vector<std::string> & attributeNames,
245  const std::vector<std::string> & values) = 0;
246 
250  virtual void writeGroupAttribute(const std::string & groupName,
251  const std::string & attributeName,
252  const std::vector<std::string> & values) = 0;
253 
257  virtual void writeGroupAttributes(const std::string & groupName,
258  const std::vector<std::string> & attributeNames,
259  const std::vector<double> & values) = 0;
260 
264  virtual void writeGroupAttributes(const std::string & groupName,
265  const std::vector<std::string> & attributeNames,
266  const std::vector<int> & values) = 0;
267 
271  virtual void writeDatasetAttributes(const std::string & datasetName,
272  const std::vector<std::string> & attributeNames,
273  const std::vector<std::string> & values) = 0;
274 
278  virtual void writeDatasetAttribute(const std::string & datasetName,
279  const std::string & attributeName,
280  const std::vector<std::string> & values) = 0;
281 
285  virtual void writeDatasetAttributes(const std::string & datasetName,
286  const std::vector<std::string> & attributeNames,
287  const std::vector<double> & values) = 0;
288 
292  virtual void writeDatasetAttributes(const std::string & datasetName,
293  const std::vector<std::string> & attributeNames,
294  const std::vector<int> & values) = 0;
295 
300  virtual std::string readStringAttribute(const std::string & obj_name,
301  const std::string & attr_name) const = 0;
302 
303  virtual std::vector<std::string> readStringArrayAttribute(const std::string & obj_name,
304  const std::string & attr_name) const = 0;
305 
310  virtual double readDoubleAttribute(const std::string & obj_name,
311  const std::string & attr_name) const = 0;
312 
317  virtual LONG64 readLongAttribute(const std::string & obj_name,
318  const std::string & attr_name) const = 0;
319 
325  virtual void readArrayNdOfDoubleValues(const std::string & datasetName, double* values) = 0;
326 
335  virtual void readArrayNdOfDoubleValues(
336  const std::string & datasetName,
337  double* values,
338  unsigned long long * numValuesInEachDimension,
339  unsigned long long * offsetInEachDimension,
340  const unsigned int & numDimensions
341  ) = 0;
342 
353  virtual void readArrayNdOfDoubleValues(
354  const std::string & datasetName,
355  double* values,
356  unsigned long long * blockCountPerDimension,
357  unsigned long long * offsetInEachDimension,
358  unsigned long long * strideInEachDimension,
359  unsigned long long * blockSizeInEachDimension,
360  const unsigned int & numDimensions) = 0;
361 
375  virtual void selectArrayNdOfValues(
376  const std::string & datasetName,
377  unsigned long long * blockCountPerDimension,
378  unsigned long long * offsetInEachDimension,
379  unsigned long long * strideInEachDimension,
380  unsigned long long * blockSizeInEachDimension,
381  const unsigned int & numDimensions,
382  bool newSelection,
383  int & dataset,
384  int & filespace) = 0;
385 
393  virtual void readArrayNdOfDoubleValues(
394  int dataset,
395  int filespace,
396  void* values,
397  unsigned long long slabSize) = 0;
398 
404  virtual void readArrayNdOfFloatValues(const std::string & datasetName, float* values) = 0;
405 
414  virtual void readArrayNdOfFloatValues(
415  const std::string & datasetName,
416  float* values,
417  unsigned long long * numValuesInEachDimension,
418  unsigned long long * offsetInEachDimension,
419  const unsigned int & numDimensions
420  ) = 0;
421 
425  virtual void readArrayNdOfGSoapLong64Values(const std::string & datasetName, LONG64* values) = 0;
426 
430  virtual void readArrayNdOfGSoapULong64Values(const std::string & datasetName, ULONG64* values) = 0;
431 
437  virtual void readArrayNdOfLongValues(const std::string & datasetName, long* values) = 0;
438 
447  virtual void readArrayNdOfLongValues(
448  const std::string & datasetName,
449  long* values,
450  unsigned long long * numValuesInEachDimension,
451  unsigned long long * offsetInEachDimension,
452  const unsigned int & numDimensions
453  ) = 0;
454 
460  virtual void readArrayNdOfULongValues(const std::string & datasetName, unsigned long* values) = 0;
461 
467  virtual void readArrayNdOfIntValues(const std::string & datasetName, int* values) = 0;
468 
477  virtual void readArrayNdOfIntValues(
478  const std::string & datasetName,
479  int* values,
480  unsigned long long * numValuesInEachDimension,
481  unsigned long long * offsetInEachDimension,
482  const unsigned int & numDimensions
483  ) = 0;
484 
490  virtual void readArrayNdOfUIntValues(const std::string & datasetName, unsigned int* values) = 0;
491 
498  virtual void readArrayNdOfShortValues(const std::string & datasetName, short* values) = 0;
499 
505  virtual void readArrayNdOfUShortValues(const std::string & datasetName, unsigned short* values) = 0;
506 
512  virtual void readArrayNdOfCharValues(const std::string & datasetName, char* values) = 0;
513 
518  virtual void readArrayNdOfUCharValues(const std::string & datasetName, unsigned char* values) = 0;
519 
524  virtual std::vector<unsigned long long> readArrayDimensions(const std::string & datasetName) = 0;
525 
529  virtual bool exist(const std::string & absolutePathInHdfFile) const = 0;
530 
531  friend void RESQML2_NS::AbstractRepresentation::setHdfProxy(COMMON_NS::AbstractHdfProxy * proxy);
533  friend void PRODML2_0_NS::DasAcquisition::setHdfProxy(COMMON_NS::AbstractHdfProxy * proxy);
534 
535  };
536 }
537 
Definition: EpcExternalPartReference.h:34
void setHdfProxy(COMMON_NS::AbstractHdfProxy *proxy)
Definition: AbstractProperty.cpp:399
Definition: AbstractHdfProxy.h:30
Definition: AbstractHdfProxy.h:28