My Project
AbstractHdfProxy.h
1 /*-----------------------------------------------------------------------
2 Copyright F2I-CONSULTING, (2014-2017)
3 
4 philippe.verney@f2i-consulting.com
5 
6 This software is a computer program whose purpose is to access to data formatted using Energistics standards.
7 
8 This software is governed by the CeCILL-B license under French law and
9 abiding by the rules of distribution of free software. You can use,
10 modify and/ or redistribute the software under the terms of the CeCILL-B
11 license as circulated by CEA, CNRS and INRIA at the following URL
12 "http://www.cecill.info".
13 
14 As a counterpart to the access to the source code and rights to copy,
15 modify and redistribute granted by the license, users are provided only
16 with a limited warranty and the software's author, the holder of the
17 economic rights, and the successive licensors have only limited
18 liability.
19 
20 In this respect, the user's attention is drawn to the risks associated
21 with loading, using, modifying and/or developing or reproducing the
22 software by the user in light of its specific status of free software,
23 that may mean that it is complicated to manipulate, and that also
24 therefore means that it is reserved for developers and experienced
25 professionals having in-depth computer knowledge. Users are therefore
26 encouraged to load and test the software's suitability as regards their
27 requirements in conditions enabling the security of their systems and/or
28 data to be ensured and, more generally, to use and operate it in the
29 same conditions as regards security.
30 
31 The fact that you are presently reading this means that you have had
32 knowledge of the CeCILL-B license and that you accept its terms.
33 -----------------------------------------------------------------------*/
34 #pragma once
35 
36 #include "common/EpcExternalPartReference.h"
37 #include "resqml2/AbstractRepresentation.h"
38 #include "prodml2_0/DasAcquisition.h"
39 
40 #define CUMULATIVE_LENGTH_DS_NAME "cumulativeLength"
41 #define ELEMENTS_DS_NAME "elements"
42 
43 namespace common
44 {
45  class DLL_IMPORT_OR_EXPORT AbstractHdfProxy : public EpcExternalPartReference
46  {
47  protected:
48 
52  AbstractHdfProxy(const std::string & packageDirAbsolutePath, const std::string & externalFilePath);
53 
54  AbstractHdfProxy(gsoap_resqml2_0_1::_eml20__EpcExternalPartReference* fromGsoap, const std::string & packageDirAbsolutePath, const std::string & externalFilePath) :
55  EpcExternalPartReference(fromGsoap, packageDirAbsolutePath, externalFilePath) {}
56 
57  AbstractHdfProxy(gsoap_eml2_1::_eml21__EpcExternalPartReference* fromGsoap, const std::string & packageDirAbsolutePath, const std::string & externalFilePath) :
58  EpcExternalPartReference(fromGsoap, packageDirAbsolutePath, externalFilePath) {}
59 
64  void initGsoapProxy(soap* soapContext, const std::string & guid, const std::string & title, const EmlVersion & emlVersion);
65 
66  public:
67  virtual ~AbstractHdfProxy() {}
68 
73  virtual void open() = 0;
74 
78  virtual bool isOpened() const = 0;
79 
83  virtual void close() = 0;
84 
89  virtual int getHdfDatatypeInDataset(const std::string & datasetName) const = 0;
90 
95  virtual int getHdfDatatypeClassInDataset(const std::string & datasetName) const = 0;
96 
109  virtual void writeItemizedListOfList(const std::string & groupName,
110  const std::string & name,
111  const int & cumulativeLengthDatatype,
112  void * cumulativeLength,
113  const unsigned long long & cumulativeLengthSize,
114  const int & elementsDatatype,
115  void * elements,
116  const unsigned long long & elementsSize) = 0;
117 
122  virtual unsigned int getDimensionCount(const std::string & datasetName) = 0;
123 
128  virtual signed long long getElementCount(const std::string & datasetName) = 0;
129 
134  virtual void setCompressionLevel(const unsigned int & newCompressionLevel) = 0;
135 
136  virtual void writeArrayNdOfFloatValues(const std::string & groupName,
137  const std::string & name,
138  float * floatValues,
139  unsigned long long * numValuesInEachDimension,
140  const unsigned int & numDimensions) = 0;
141 
151  virtual void writeArrayNdOfDoubleValues(const std::string & groupName,
152  const std::string & name,
153  double * dblValues,
154  unsigned long long * numValuesInEachDimension,
155  const unsigned int & numDimensions) = 0;
156 
166  virtual void writeArrayNdOfCharValues(const std::string & groupName,
167  const std::string & name,
168  char * intValues,
169  unsigned long long * numValuesInEachDimension,
170  const unsigned int & numDimensions) = 0;
171 
181  virtual void writeArrayNdOfIntValues(const std::string & groupName,
182  const std::string & name,
183  int * intValues,
184  unsigned long long * numValuesInEachDimension,
185  const unsigned int & numDimensions) = 0;
186 
196  virtual void writeArrayNdOfGSoapULong64Values(const std::string & groupName,
197  const std::string & name,
198  ULONG64 * ulong64Values,
199  unsigned long long * numValuesInEachDimension,
200  const unsigned int & numDimensions) = 0;
201 
212  virtual void writeArrayNd(const std::string & groupName,
213  const std::string & name,
214  const int & datatype,
215  void * values,
216  unsigned long long * numValuesInEachDimension,
217  const unsigned int & numDimensions) = 0;
218 
228  virtual void createArrayNd(
229  const std::string& groupName,
230  const std::string& name,
231  const int & datatype,
232  unsigned long long* numValuesInEachDimension,
233  const unsigned int& numDimensions
234  ) = 0;
235 
245  virtual void writeArrayNdSlab(
246  const std::string& groupName,
247  const std::string& name,
248  const int & datatype,
249  void* values,
250  unsigned long long* numValuesInEachDimension,
251  unsigned long long* offsetValuesInEachDimension,
252  const unsigned int& numDimensions
253  ) = 0;
254 
258  virtual void writeGroupAttributes(const std::string & groupName,
259  const std::vector<std::string> & attributeNames,
260  const std::vector<std::string> & values) = 0;
261 
265  virtual void writeGroupAttribute(const std::string & groupName,
266  const std::string & attributeName,
267  const std::vector<std::string> & values) = 0;
268 
272  virtual void writeGroupAttributes(const std::string & groupName,
273  const std::vector<std::string> & attributeNames,
274  const std::vector<double> & values) = 0;
275 
279  virtual void writeGroupAttributes(const std::string & groupName,
280  const std::vector<std::string> & attributeNames,
281  const std::vector<int> & values) = 0;
282 
286  virtual void writeDatasetAttributes(const std::string & datasetName,
287  const std::vector<std::string> & attributeNames,
288  const std::vector<std::string> & values) = 0;
289 
293  virtual void writeDatasetAttribute(const std::string & datasetName,
294  const std::string & attributeName,
295  const std::vector<std::string> & values) = 0;
296 
300  virtual void writeDatasetAttributes(const std::string & datasetName,
301  const std::vector<std::string> & attributeNames,
302  const std::vector<double> & values) = 0;
303 
307  virtual void writeDatasetAttributes(const std::string & datasetName,
308  const std::vector<std::string> & attributeNames,
309  const std::vector<int> & values) = 0;
310 
315  virtual std::string readStringAttribute(const std::string & obj_name,
316  const std::string & attr_name) const = 0;
317 
318  virtual std::vector<std::string> readStringArrayAttribute(const std::string & obj_name,
319  const std::string & attr_name) const = 0;
320 
325  virtual double readDoubleAttribute(const std::string & obj_name,
326  const std::string & attr_name) const = 0;
327 
332  virtual LONG64 readLongAttribute(const std::string & obj_name,
333  const std::string & attr_name) const = 0;
334 
340  virtual void readArrayNdOfDoubleValues(const std::string & datasetName, double* values) = 0;
341 
350  virtual void readArrayNdOfDoubleValues(
351  const std::string & datasetName,
352  double* values,
353  unsigned long long * numValuesInEachDimension,
354  unsigned long long * offsetInEachDimension,
355  const unsigned int & numDimensions
356  ) = 0;
357 
363  virtual void readArrayNdOfFloatValues(const std::string & datasetName, float* values) = 0;
364 
373  virtual void readArrayNdOfFloatValues(
374  const std::string & datasetName,
375  float* values,
376  unsigned long long * numValuesInEachDimension,
377  unsigned long long * offsetInEachDimension,
378  const unsigned int & numDimensions
379  ) = 0;
380 
384  virtual void readArrayNdOfGSoapLong64Values(const std::string & datasetName, LONG64* values) = 0;
385 
389  virtual void readArrayNdOfGSoapULong64Values(const std::string & datasetName, ULONG64* values) = 0;
390 
396  virtual void readArrayNdOfLongValues(const std::string & datasetName, long* values) = 0;
397 
406  virtual void readArrayNdOfLongValues(
407  const std::string & datasetName,
408  long* values,
409  unsigned long long * numValuesInEachDimension,
410  unsigned long long * offsetInEachDimension,
411  const unsigned int & numDimensions
412  ) = 0;
413 
419  virtual void readArrayNdOfULongValues(const std::string & datasetName, unsigned long* values) = 0;
420 
426  virtual void readArrayNdOfIntValues(const std::string & datasetName, int* values) = 0;
427 
436  virtual void readArrayNdOfIntValues(
437  const std::string & datasetName,
438  int* values,
439  unsigned long long * numValuesInEachDimension,
440  unsigned long long * offsetInEachDimension,
441  const unsigned int & numDimensions
442  ) = 0;
443 
449  virtual void readArrayNdOfUIntValues(const std::string & datasetName, unsigned int* values) = 0;
450 
457  virtual void readArrayNdOfShortValues(const std::string & datasetName, short* values) = 0;
458 
464  virtual void readArrayNdOfUShortValues(const std::string & datasetName, unsigned short* values) = 0;
465 
471  virtual void readArrayNdOfCharValues(const std::string & datasetName, char* values) = 0;
472 
477  virtual void readArrayNdOfUCharValues(const std::string & datasetName, unsigned char* values) = 0;
478 
483  virtual std::vector<unsigned long long> readArrayDimensions(const std::string & datasetName) = 0;
484 
488  virtual bool exist(const std::string & absolutePathInHdfFile) const = 0;
489 
490  friend void resqml2::AbstractRepresentation::setHdfProxy(common::AbstractHdfProxy * proxy);
492  friend void prodml2_0::DasAcquisition::setHdfProxy(common::AbstractHdfProxy * proxy);
493 
494  };
495 }
Definition: AbstractHdfProxy.h:43
Definition: EpcExternalPartReference.h:49
void setHdfProxy(common::AbstractHdfProxy *proxy)
Definition: AbstractProperty.cpp:414
Definition: AbstractHdfProxy.h:45