Fesapi 2.14.0.0
This project provides C++ classes which allow an easy access in import and export to the Energistics standards.
Loading...
Searching...
No Matches
ContinuousProperty.h
1/*-----------------------------------------------------------------------
2Licensed to the Apache Software Foundation (ASF) under one
3or more contributor license agreements. See the NOTICE file
4distributed with this work for additional information
5regarding copyright ownership. The ASF licenses this file
6to you under the Apache License, Version 2.0 (the
7"License"; you may not use this file except in compliance
8with the License. You may obtain a copy of the License at
9
10 http://www.apache.org/licenses/LICENSE-2.0
11
12Unless required by applicable law or agreed to in writing,
13software distributed under the License is distributed on an
14"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15KIND, either express or implied. See the License for the
16specific language governing permissions and limitations
17under the License.
18-----------------------------------------------------------------------*/
19#pragma once
20
21#include "../resqml2/ContinuousProperty.h"
22#include "../eml2/AbstractHdfProxy.h"
23
24#include <stdexcept>
25#include <sstream>
26
27namespace RESQML2_0_1_NS
28{
36 class ContinuousProperty final : public RESQML2_NS::ContinuousProperty
37 {
38 public:
39
45 DLL_IMPORT_OR_EXPORT ContinuousProperty(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject) : RESQML2_NS::ContinuousProperty(partialObject) {}
46
72 ContinuousProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title,
73 unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, gsoap_resqml2_0_1::resqml20__ResqmlUom uom, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind);
74
98 ContinuousProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title,
99 unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, gsoap_resqml2_0_1::resqml20__ResqmlUom uom, EML2_NS::PropertyKind * localPropKind);
100
125 ContinuousProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title,
126 unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, const std::string & nonStandardUom, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind);
127
149 ContinuousProperty(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title,
150 unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, const std::string & nonStandardUom, EML2_NS::PropertyKind * localPropKind);
151
157 ContinuousProperty(gsoap_resqml2_0_1::_resqml20__ContinuousProperty* fromGsoap): RESQML2_NS::ContinuousProperty(fromGsoap) {}
158
161
170 DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::resqml20__ResqmlUom getUom() const final;
171
180 DLL_IMPORT_OR_EXPORT std::string getUomAsString() const final;
181
182 DLL_IMPORT_OR_EXPORT double getMinimumValue(uint64_t index = 0) const final;
183
184 DLL_IMPORT_OR_EXPORT double getMaximumValue(uint64_t index = 0) const final;
185
186 DLL_IMPORT_OR_EXPORT void setMinimumValue(double value, uint64_t index = 0) const final;
187
188 DLL_IMPORT_OR_EXPORT void setMaximumValue(double value, uint64_t index = 0) const final;
189
198 DLL_IMPORT_OR_EXPORT gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind getEnergisticsPropertyKind() const;
199
201
202 bool validatePropertyKindAssociation(gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind pk) final;
203
204 DLL_IMPORT_OR_EXPORT COMMON_NS::NumberArrayStatistics<float> getFloatStatistics(uint64_t) const final {
205 COMMON_NS::NumberArrayStatistics<float> result;
206 const auto minimumValueSize = getMinimumValueSize();
207 for (size_t i = 0; i < minimumValueSize; ++i) {
208 const auto minVal = getMinimumValue(i);
209 if (!std::isnan(minVal)) {
210 result.setMinimum(static_cast<float>(minVal), i);
211 }
212 }
213 const auto maximumValueSize = getMaximumValueSize();
214 for (size_t i = 0; i < maximumValueSize; ++i) {
215 const auto maxVal = getMinimumValue(i);
216 if (!std::isnan(maxVal)) {
217 result.setMaximum(static_cast<float>(maxVal), i);
218 }
219 }
220 return result;
221 }
222 DLL_IMPORT_OR_EXPORT COMMON_NS::NumberArrayStatistics<double> getDoubleStatistics(uint64_t) const final {
223 COMMON_NS::NumberArrayStatistics<double> result;
224 const auto minimumValueSize = getMinimumValueSize();
225 for (size_t i = 0; i < minimumValueSize; ++i) {
226 const auto minVal = getMinimumValue(i);
227 if (!std::isnan(minVal)) {
228 result.setMinimum(minVal, i);
229 }
230 }
231 const auto maximumValueSize = getMaximumValueSize();
232 for (size_t i = 0; i < maximumValueSize; ++i) {
233 const auto maxVal = getMinimumValue(i);
234 if (!std::isnan(maxVal)) {
235 result.setMaximum(maxVal, i);
236 }
237 }
238 return result;
239 }
240
244 DLL_IMPORT_OR_EXPORT static const char* XML_NS;
245
249 DLL_IMPORT_OR_EXPORT std::string getXmlNamespace() const final { return XML_NS; }
250
251 private:
252
263 void init(RESQML2_NS::AbstractRepresentation * rep, const std::string & guid, const std::string & title,
264 unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind);
265
266 EML2_NS::AbstractHdfProxy* getValuesHdfProxyAndDatasetPathOfPatch(uint64_t patchIndex, std::string & datasetPath) const;
267
268 size_t getMinimumValueSize() const;
269 size_t getMaximumValueSize() const;
270 };
271}
void setMinimumValue(double value, uint64_t index=0) const final
Sets the minimum value of a non vector property or the minimum value of one given value of a vector p...
std::string getUomAsString() const final
std::string getXmlNamespace() const final
Definition ContinuousProperty.h:249
ContinuousProperty(resqml2::AbstractRepresentation *rep, const std::string &guid, const std::string &title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, gsoap_resqml2_0_1::resqml20__ResqmlUom uom, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind)
static const char * XML_NS
Definition ContinuousProperty.h:244
ContinuousProperty(resqml2::AbstractRepresentation *rep, const std::string &guid, const std::string &title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, const std::string &nonStandardUom, eml2::PropertyKind *localPropKind)
gsoap_resqml2_0_1::resqml20__ResqmlUom getUom() const final
double getMinimumValue(uint64_t index=0) const final
Gets the minimum value of a non vector property or the minimum value of one given value of a vector p...
void setMaximumValue(double value, uint64_t index=0) const final
Sets the maximum value of a non vector property or the maximum value of one given value of a vector p...
bool validatePropertyKindAssociation(eml2::PropertyKind *pk) final
ContinuousProperty(resqml2::AbstractRepresentation *rep, const std::string &guid, const std::string &title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, const std::string &nonStandardUom, gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind energisticsPropertyKind)
ContinuousProperty(gsoap_resqml2_0_1::_resqml20__ContinuousProperty *fromGsoap)
Definition ContinuousProperty.h:157
double getMaximumValue(uint64_t index=0) const final
Gets the maximum value of a non vector property or the maximum value of one given value of a vector p...
ContinuousProperty(gsoap_resqml2_0_1::eml20__DataObjectReference *partialObject)
Definition ContinuousProperty.h:45
gsoap_resqml2_0_1::resqml20__ResqmlPropertyKind getEnergisticsPropertyKind() const
ContinuousProperty(resqml2::AbstractRepresentation *rep, const std::string &guid, const std::string &title, unsigned int dimension, gsoap_eml2_3::eml23__IndexableElement attachmentKind, gsoap_resqml2_0_1::resqml20__ResqmlUom uom, eml2::PropertyKind *localPropKind)
Definition PropertyKind.h:28