My Project
AbstractValuesProperty.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 <limits>
37 #include "resqml2/AbstractProperty.h"
38 
39 namespace resqml2
40 {
41  class DLL_IMPORT_OR_EXPORT AbstractValuesProperty : public AbstractProperty
42  {
43  protected:
49  std::string getPathInHdfFileOfPatch(const unsigned int & patchIndex, LONG64 & nullValue) const;
50 
59  std::string pushBackRefToExistingIntegerDataset(common::AbstractHdfProxy* hdfProxy, const std::string & datasetName = "", const long & nullValue = (std::numeric_limits<long>::max)());
60 
61  public:
62 
63  enum hdfDatatypeEnum { UNKNOWN = 0, DOUBLE = 1, FLOAT = 2, LONG = 3, ULONG = 4, INT = 5, UINT = 6, SHORT = 7, USHORT = 8, CHAR = 9, UCHAR = 10};
64 
68  AbstractValuesProperty(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : AbstractProperty(partialObject) {}
69 
75 
79  AbstractValuesProperty(gsoap_resqml2_0_1::resqml2__AbstractValuesProperty* fromGsoap) : resqml2::AbstractProperty(fromGsoap) {}
80 
85 
89  unsigned int getPatchCount() const;
90 
94  AbstractValuesProperty::hdfDatatypeEnum getValuesHdfDatatype() const;
95 
104  virtual std::string pushBackRefToExistingDataset(common::AbstractHdfProxy* hdfProxy, const std::string & datasetName = "", const long & nullValue = (std::numeric_limits<long>::max)()) = 0;
105 
111  long getLongValuesOfPatch(const unsigned int & patchIndex, long * values);
112 
118  long getNullValueOfPatch(const unsigned int & patchIndex);
119 
125  unsigned long getULongValuesOfPatch(const unsigned int & patchIndex, unsigned long * values);
126 
132  int getIntValuesOfPatch(const unsigned int & patchIndex, int * values);
133 
143  int getIntValuesOfPatch(
144  const unsigned int& patchIndex,
145  int* values,
146  unsigned long long* numValuesInEachDimension,
147  unsigned long long* offsetInEachDimension,
148  const unsigned int& numArrayDimensions
149  );
150 
162  void getIntValuesOf3dPatch(
163  const unsigned int& patchIndex,
164  int* values,
165  const unsigned int& valueCountInFastestDim,
166  const unsigned int& valueCountInMiddleDim,
167  const unsigned int& valueCountInSlowestDim,
168  const unsigned int& offsetInFastestDim,
169  const unsigned int& offsetInMiddleDim,
170  const unsigned int& offsetInSlowestDim
171  );
172 
178  unsigned int getUIntValuesOfPatch(const unsigned int & patchIndex, unsigned int * values);
179 
185  short getShortValuesOfPatch(const unsigned int & patchIndex, short * values);
186 
192  unsigned short getUShortValuesOfPatch(const unsigned int & patchIndex, unsigned short * values);
193 
199  char getCharValuesOfPatch(const unsigned int & patchIndex, char * values);
200 
206  unsigned char getUCharValuesOfPatch(const unsigned int & patchIndex, unsigned char * values);
207 
211  unsigned int getValuesCountOfPatch (const unsigned int & patchIndex);
212 
219  unsigned int getValuesCountOfDimensionOfPatch(const unsigned int & dimIndex, const unsigned int & patchIndex);
220 
226  unsigned int getDimensionsCountOfPatch(const unsigned int & patchIndex);
227 
231  void pushBackFacet(const gsoap_resqml2_0_1::resqml2__Facet & facet, const std::string & facetValue);
232 
236  unsigned int getFacetCount() const;
237 
241  gsoap_resqml2_0_1::resqml2__Facet getFacet(const unsigned int & index) const;
242 
246  std::string getFacetValue(const unsigned int & index) const;
247 
248  //***************************
249  //*** For hyperslabbing *****
250  //***************************
251 
258  void createLongHdf5ArrayOfValues(
259  unsigned long long* numValues,
260  const unsigned int& numArrayDimensions,
262  );
263 
271  void createLongHdf5Array3dOfValues(
272  const unsigned int& valueCountInFastestDim,
273  const unsigned int& valueCountInMiddleDim,
274  const unsigned int& valueCountInSlowestDim,
276  );
277 
289  void pushBackLongHdf5SlabArray3dOfValues(
290  long* values,
291  const unsigned int& valueCountInFastestDim,
292  const unsigned int& valueCountInMiddleDim,
293  const unsigned int& valueCountInSlowestDim,
294  const unsigned int& offsetInFastestDim,
295  const unsigned int& offsetInMiddleDim,
296  const unsigned int& offsetInSlowestDim,
298  );
299 
309  void pushBackLongHdf5SlabArrayOfValues(
310  long * values,
311  unsigned long long * numValues,
312  unsigned long long * offsetValues,
313  const unsigned int & numArrayDimensions,
315  );
316 
325  void getLongValuesOfPatch(
326  const unsigned int& patchIndex,
327  long* values,
328  unsigned long long* numValuesInEachDimension,
329  unsigned long long* offsetInEachDimension,
330  const unsigned int& numArrayDimensions
331  );
332 
344  void getLongValuesOf3dPatch(
345  const unsigned int& patchIndex,
346  long* values,
347  const unsigned int& valueCountInFastestDim,
348  const unsigned int& valueCountInMiddleDim,
349  const unsigned int& valueCountInSlowestDim,
350  const unsigned int& offsetInFastestDim,
351  const unsigned int& offsetInMiddleDim,
352  const unsigned int& offsetInSlowestDim
353  );
354 
355  };
356 }
virtual ~AbstractValuesProperty()
Definition: AbstractValuesProperty.h:84
Definition: AbstractValuesProperty.h:41
AbstractValuesProperty(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition: AbstractValuesProperty.h:68
AbstractValuesProperty()
Definition: AbstractValuesProperty.h:74
Definition: AbstractProperty.h:41
Definition: EpcDocument.h:62
AbstractValuesProperty(gsoap_resqml2_0_1::resqml2__AbstractValuesProperty *fromGsoap)
Definition: AbstractValuesProperty.h:79
Definition: AbstractHdfProxy.h:45