Skip to content

Commit 2d3cf24

Browse files
gsoap generate eml23__PositiveLongand eml23__NonNegativeLong as uint64_t
1 parent f68f216 commit 2d3cf24

12 files changed

Lines changed: 1441 additions & 1445 deletions

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ set (FESAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
1212

1313
# version mechanism
1414
set (Fesapi_VERSION_MAJOR 2)
15-
set (Fesapi_VERSION_MINOR 14)
16-
set (Fesapi_VERSION_PATCH 1)
15+
set (Fesapi_VERSION_MINOR 15)
16+
set (Fesapi_VERSION_PATCH 0)
1717
set (Fesapi_VERSION_TWEAK 0)
1818

1919
set (Fesapi_VERSION ${Fesapi_VERSION_MAJOR}.${Fesapi_VERSION_MINOR}.${Fesapi_VERSION_PATCH}.${Fesapi_VERSION_TWEAK})

src/common/AbstractObject.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ soap* AbstractObject::getGsoapContext() const
8585
}
8686
}
8787

88-
int AbstractObject::getGsoapType() const {
88+
long AbstractObject::getGsoapType() const {
8989
if (gsoapProxy2_0_1 != nullptr) {
9090
return gsoapProxy2_0_1->soap_type();
9191
}
@@ -903,8 +903,12 @@ void AbstractObject::readArrayNdOfFloatValues(gsoap_resqml2_0_1::resqml20__Abstr
903903
if (latticeArray->Offset[0]->Value < (std::numeric_limits<float>::min)() || latticeArray->Offset[0]->Value >(std::numeric_limits<float>::max)()) {
904904
throw out_of_range("The double offset value of the lattice array " + std::to_string(latticeArray->Offset[0]->Value) + " is out of float range value");
905905
}
906-
for (size_t i = 0; i <= latticeArray->Offset[0]->Count; ++i) {
907-
arrayOutput[i] = static_cast<float>(latticeArray->StartValue) + (i * static_cast<float>(latticeArray->Offset[0]->Value));
906+
907+
const float start = static_cast<float>(latticeArray->StartValue);
908+
const float step = static_cast<float>(latticeArray->Offset[0]->Value);
909+
const size_t count = latticeArray->Offset[0]->Count;
910+
for (size_t i = 0; i <= count; ++i) {
911+
arrayOutput[i] = start + static_cast<float>(i) * step;
908912
}
909913
}
910914
else
@@ -945,8 +949,12 @@ void AbstractObject::readArrayNdOfFloatValues(gsoap_eml2_3::eml23__AbstractFloat
945949
if (latticeArray->Offset[0]->Value < (std::numeric_limits<float>::min)() || latticeArray->Offset[0]->Value >(std::numeric_limits<float>::max)()) {
946950
throw out_of_range("The double offset value of the lattice array " + std::to_string(latticeArray->Offset[0]->Value) + " is out of float range value");
947951
}
948-
for (size_t i = 0; i <= static_cast<size_t>(latticeArray->Offset[0]->Count); ++i) {
949-
arrayOutput[i] = static_cast<float>(latticeArray->StartValue) + (i * static_cast<float>(latticeArray->Offset[0]->Value));
952+
953+
const float start = static_cast<float>(latticeArray->StartValue);
954+
const float step = static_cast<float>(latticeArray->Offset[0]->Value);
955+
const size_t count = latticeArray->Offset[0]->Count;
956+
for (size_t i = 0; i <= count; ++i) {
957+
arrayOutput[i] = start + static_cast<float>(i) * step;
950958
}
951959
break;
952960
}
@@ -996,8 +1004,12 @@ void AbstractObject::readArrayNdOfDoubleValues(gsoap_resqml2_0_1::resqml20__Abst
9961004
if (latticeArray->Offset.size() > 1) {
9971005
throw invalid_argument("The integer lattice array contains more than one offset.");
9981006
}
999-
for (size_t i = 0; i <= latticeArray->Offset[0]->Count; ++i) {
1000-
arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
1007+
1008+
const double start = latticeArray->StartValue;
1009+
const double step = latticeArray->Offset[0]->Value;
1010+
const size_t count = latticeArray->Offset[0]->Count;
1011+
for (size_t i = 0; i <= count; ++i) {
1012+
arrayOutput[i] = start + (static_cast<double>(i) * step);
10011013
}
10021014
}
10031015
else

src/common/AbstractObject.h

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ namespace COMMON_NS
411411
*
412412
* @returns The gSOAP type.
413413
*/
414-
int getGsoapType() const;
414+
long getGsoapType() const;
415415

416416
/**
417417
* Creates an returns an EML2.0 data object reference which targets this data object
@@ -831,11 +831,13 @@ namespace COMMON_NS
831831
throw std::underflow_error("Cannot deal with negative values when using unsigned integer");
832832
}
833833
}
834-
if (rangeArray->Value + rangeArray->Count > static_cast<uint64_t>((std::numeric_limits<T>::max)())) {
835-
throw std::overflow_error("The range integer values are superior to maximum value of read datatype.");
834+
if (rangeArray->Count > static_cast<uint64_t>((std::numeric_limits<T>::max)())) {
835+
throw std::overflow_error("Please use a larger integer type");
836836
}
837-
for (T i = 0; i < static_cast<T>(rangeArray->Count); ++i) {
838-
arrayOutput[i] = i + static_cast<T>(rangeArray->Value);
837+
const T initialValue = static_cast<T>(rangeArray->Value);
838+
const T count = static_cast<T>(rangeArray->Count);
839+
for (T i = 0; i < count; ++i) {
840+
arrayOutput[i] = i + initialValue;
839841
}
840842
return (std::numeric_limits<T>::max)();
841843
}
@@ -872,7 +874,8 @@ namespace COMMON_NS
872874
throw std::underflow_error("Too low integers in XML for the C++ chosen datatype");
873875
}
874876
if (latticeArray->StartValue > (std::numeric_limits<T>::max)() ||
875-
latticeArray->Offset[0]->Value > (std::numeric_limits<T>::max)()) {
877+
latticeArray->Offset[0]->Value > (std::numeric_limits<T>::max)() ||
878+
latticeArray->Offset[0]->Count > (std::numeric_limits<T>::max)()) {
876879
throw std::overflow_error("Too big integers in XML for the C++ chosen datatype");
877880
}
878881
}
@@ -881,12 +884,16 @@ namespace COMMON_NS
881884
throw std::underflow_error("Cannot deal with negative values when using unsigned integer");
882885
}
883886
if (static_cast<uint64_t>(latticeArray->StartValue) > (std::numeric_limits<T>::max)() ||
884-
static_cast<uint64_t>(latticeArray->Offset[0]->Value) > (std::numeric_limits<T>::max)()) {
887+
static_cast<uint64_t>(latticeArray->Offset[0]->Value) > (std::numeric_limits<T>::max)() ||
888+
static_cast<uint64_t>(latticeArray->Offset[0]->Count) > (std::numeric_limits<T>::max)()) {
885889
throw std::overflow_error("Too big integers in XML for the C++ chosen datatype");
886890
}
887891
}
888-
for (uint64_t i = 0; i <= latticeArray->Offset[0]->Count; ++i) {
889-
arrayOutput[i] = static_cast<T>(latticeArray->StartValue) + (i * static_cast<T>(latticeArray->Offset[0]->Value));
892+
const T start = static_cast<T>(latticeArray->StartValue);
893+
const T step = static_cast<T>(latticeArray->Offset[0]->Value);
894+
const T count = static_cast<T>(latticeArray->Offset[0]->Count);
895+
for (T i = 0; i <= count; ++i) {
896+
arrayOutput[i] = start + i * step;
890897
}
891898
return (std::numeric_limits<T>::max)();
892899
}

src/prodml2_3/FluidCharacterization.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ void FluidCharacterization::pushBackPlusFluidComponent(const std::string & uid,
281281
}
282282
SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES_IMPL(PlusFluidComponent)
283283
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PlusFluidComponent, SpecificGravity, double, soap_new_double)
284-
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PlusFluidComponent, StartingCarbonNumber, int64_t, soap_new_LONG64)
284+
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PlusFluidComponent, StartingCarbonNumber, uint64_t, soap_new_ULONG64)
285285
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PlusFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom, gsoap_eml2_3::soap_new_eml23__ThermodynamicTemperatureMeasure)
286286
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PlusFluidComponent, AvgDensity, std::string, gsoap_eml2_3::soap_new_eml23__MassPerVolumeMeasure)
287287
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PlusFluidComponent, AvgMolecularWeight, gsoap_eml2_3::eml23__MolecularWeightUom, gsoap_eml2_3::soap_new_eml23__MolecularWeightMeasure)
@@ -371,8 +371,8 @@ void FluidCharacterization::pushBackPseudoFluidComponent(const std::string & uid
371371
}
372372
SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES_IMPL(PseudoFluidComponent)
373373
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, SpecificGravity, double, soap_new_double)
374-
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, StartingCarbonNumber, int64_t, soap_new_LONG64)
375-
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, EndingCarbonNumber, int64_t, soap_new_LONG64)
374+
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, StartingCarbonNumber, uint64_t, soap_new_ULONG64)
375+
SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE_IMPL(PseudoFluidComponent, EndingCarbonNumber, uint64_t, soap_new_ULONG64)
376376
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PseudoFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom, gsoap_eml2_3::soap_new_eml23__ThermodynamicTemperatureMeasure)
377377
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PseudoFluidComponent, EndingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom, gsoap_eml2_3::soap_new_eml23__ThermodynamicTemperatureMeasure)
378378
SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE_IMPL(PseudoFluidComponent, AvgBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom, gsoap_eml2_3::soap_new_eml23__ThermodynamicTemperatureMeasure)

src/prodml2_3/FluidCharacterization.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ namespace PRODML2_3_NS
293293
DLL_IMPORT_OR_EXPORT void pushBackPlusFluidComponent(const std::string & uid, gsoap_eml2_3::prodml23__PlusComponentKind kind);
294294
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(PlusFluidComponent)
295295
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PlusFluidComponent, SpecificGravity, double)
296-
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PlusFluidComponent, StartingCarbonNumber, int64_t)
296+
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PlusFluidComponent, StartingCarbonNumber, uint64_t)
297297
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PlusFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
298298
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PlusFluidComponent, AvgDensity, std::string)
299299
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PlusFluidComponent, AvgMolecularWeight, gsoap_eml2_3::eml23__MolecularWeightUom)
@@ -356,8 +356,8 @@ namespace PRODML2_3_NS
356356
DLL_IMPORT_OR_EXPORT void pushBackPseudoFluidComponent(const std::string & uid, gsoap_eml2_3::prodml23__PseudoComponentKind kind);
357357
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_COMMON_ATTRIBUTES(PseudoFluidComponent)
358358
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, SpecificGravity, double)
359-
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, StartingCarbonNumber, int64_t)
360-
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, EndingCarbonNumber, int64_t)
359+
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, StartingCarbonNumber, uint64_t)
360+
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_OPTIONAL_ATTRIBUTE(PseudoFluidComponent, EndingCarbonNumber, uint64_t)
361361
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, StartingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
362362
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, EndingBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)
363363
GETTER_AND_SETTER_FLUID_CATALOG_COMPONENT_MEASURE_ATTRIBUTE(PseudoFluidComponent, AvgBoilingPoint, gsoap_eml2_3::eml23__ThermodynamicTemperatureUom)

src/proxies/envC.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Product and source code licensed by Genivia Inc., contact@genivia.com
1717

1818
#include "envH.h"
1919

20-
SOAP_SOURCE_STAMP("@(#) envC.cpp ver 2.8.140E 2026-02-16 09:13:49 GMT")
20+
SOAP_SOURCE_STAMP("@(#) envC.cpp ver 2.8.140E 2026-03-17 16:59:43 GMT")
2121

2222

2323
#ifndef WITH_NOGLOBAL

0 commit comments

Comments
 (0)