Skip to content

Commit

Permalink
Make LocalCrs an EML2 class to ease RESQML2.2 upgrade
Browse files Browse the repository at this point in the history
Add Well head elevation support to WITSML2.1
Add CRS to WITSML2.1 elevations
Upgrade some int32 to int64 (in Activity* classes for instance)
  • Loading branch information
philippeVerney committed Jan 26, 2024
1 parent dcac003 commit ad5c0ce
Show file tree
Hide file tree
Showing 142 changed files with 5,879 additions and 1,547 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ set (FESAPI_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})

# version mechanism
set (Fesapi_VERSION_MAJOR 2)
set (Fesapi_VERSION_MINOR 9)
set (Fesapi_VERSION_MINOR 10)
set (Fesapi_VERSION_PATCH 0)
set (Fesapi_VERSION_TWEAK 1)
set (Fesapi_VERSION_TWEAK 0)

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

Expand Down
16 changes: 8 additions & 8 deletions cmake/swigCsInclude.i
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Basically this file add methods resqml2_0_instantiate* which will create the rig
HORIZONINTERPRETATION,
IJKGRIDREPRESENTATION,
LOCALDEPTH3DCRS,
LOCALENGINEERING2DCRS,
LOCALENGINEERINGCOMPOUNDCRS,
LOCALTIME3DCRS,
LOG,
MDDATUM,
Expand Down Expand Up @@ -103,6 +105,7 @@ Basically this file add methods resqml2_0_instantiate* which will create the rig
TRIANGULATEDSETREPRESENTATION,
TRUNCATEDIJKGRIDREPRESENTATION,
UNSTRUCTUREDGRIDREPRESENTATION,
VERTICALCRS,
WELL,
WELLBORE,
WELLBORECOMPLETION,
Expand Down Expand Up @@ -897,14 +900,14 @@ ${COMMENT_END}
case DataObjectName.GENERICFEATUREINTERPRETATION : return resqml2_instantiateGenericFeatureInterpretation(cPtr, owner);
case DataObjectName.GEOLOGICUNITFEATURE : return new F2iConsulting.Fesapi.${FESAPI_RESQML2_0_1_NS}.GeologicUnitFeature(cPtr, owner);
case DataObjectName.STRATIGRAPHICOCCURRENCEINTERPRETATION : return resqml2_instantiateStratigraphicOccurrenceInterpretation(cPtr, owner);
${COMMENT_START}
case DataObjectName.GRAPHICALINFORMATIONSET : return new F2iConsulting.Fesapi.${FESAPI_EML2_3_NS}.GraphicalInformationSet(cPtr, owner);
${COMMENT_END}
case DataObjectName.GRID2DREPRESENTATION : return resqml2_instantiateGrid2dRepresentation(cPtr, owner);
case DataObjectName.GRIDCONNECTIONSETREPRESENTATION : return resqml2_instantiateGridConnectionSetRepresentation(cPtr, owner);
case DataObjectName.HORIZONINTERPRETATION : return resqml2_instantiateHorizonInterpretation(cPtr, owner);
case DataObjectName.IJKGRIDREPRESENTATION : return resqml2_instantiateConcreteIjkGridRepresentation(cPtr, owner);
case DataObjectName.LOCALDEPTH3DCRS : return new F2iConsulting.Fesapi.${FESAPI_RESQML2_0_1_NS}.LocalDepth3dCrs(cPtr, owner);
case DataObjectName.LOCALENGINEERING2DCRS : return new F2iConsulting.Fesapi.${FESAPI_EML2_3_NS}.LocalEngineering2dCrs(cPtr, owner);
case DataObjectName.LOCALENGINEERINGCOMPOUNDCRS : return F2iConsulting.Fesapi.${FESAPI_EML2_3_NS}.LocalEngineeringCompoundCrs(cPtr, owner)
case DataObjectName.LOCALTIME3DCRS : return new F2iConsulting.Fesapi.${FESAPI_RESQML2_0_1_NS}.LocalTime3dCrs(cPtr, owner);
case DataObjectName.LOG : return new F2iConsulting.Fesapi.${FESAPI_WITSML2_1_NS}.Log(cPtr, owner);
case DataObjectName.MDDATUM : return new F2iConsulting.Fesapi.${FESAPI_RESQML2_0_1_NS}.MdDatum(cPtr, owner);
Expand Down Expand Up @@ -952,6 +955,7 @@ ${COMMENT_END}
case DataObjectName.TRIANGULATEDSETREPRESENTATION : return resqml2_instantiateTriangulatedSetRepresentation(cPtr, owner);
case DataObjectName.TRUNCATEDIJKGRIDREPRESENTATION : return resqml2_instantiateConcreteIjkGridRepresentation(cPtr, owner);
case DataObjectName.UNSTRUCTUREDGRIDREPRESENTATION : return resqml2_instantiateUnstructuredGridRepresentation(cPtr, owner);
case DataObjectName.VERTICALCRS : return new F2iConsulting.Fesapi.${FESAPI_EML2_3_NS}.VerticalCrs(cPtr, owner);
case DataObjectName.WELL : return new F2iConsulting.Fesapi.${FESAPI_WITSML2_1_NS}.Well(cPtr, owner);
case DataObjectName.WELLBORE : return new F2iConsulting.Fesapi.${FESAPI_WITSML2_1_NS}.Wellbore(cPtr, owner);
case DataObjectName.WELLBORECOMPLETION : return new F2iConsulting.Fesapi.${FESAPI_WITSML2_1_NS}.WellboreCompletion(cPtr, owner);
Expand Down Expand Up @@ -979,10 +983,8 @@ namespace COMMON_NS

namespace EML2_NS
{
%typemap(csout, excode=SWIGEXCODE) Activity*, ActivityTemplate*, EpcExternalPartReference*, PropertyKind*, TimeSeries*
#ifdef WITH_RESQML2_2
%typemap(csout, excode=SWIGEXCODE) Activity*, ActivityTemplate*, EpcExternalPartReference*, PropertyKind*, TimeSeries*, AbstractLocal3dCrs*
,GraphicalInformationSet*
#endif
{
global::System.IntPtr cPtr = $imcall;
$csclassname ret = ($csclassname) $modulePINVOKE.eml2_instantiateConcreteObject(cPtr, $owner);$excode
Expand All @@ -1002,7 +1004,7 @@ namespace WITSML2_NS

namespace RESQML2_NS
{
%typemap(csout, excode=SWIGEXCODE) AbstractFeature*, AbstractFeatureInterpretation*, AbstractRepresentation*, AbstractGridRepresentation*, AbstractLocal3dCrs*,
%typemap(csout, excode=SWIGEXCODE) AbstractFeature*, AbstractFeatureInterpretation*, AbstractRepresentation*, AbstractGridRepresentation*,
AbstractProperty*, AbstractValuesProperty*,
AbstractIjkGridRepresentation*, AbstractStratigraphicOrganizationInterpretation*,
#ifdef WITH_RESQML2_2
Expand Down Expand Up @@ -1042,8 +1044,6 @@ namespace RESQML2_NS
IjkGridLatticeRepresentation*,
IjkGridNoGeometryRepresentation*,
IjkGridParametricRepresentation*,
LocalDepth3dCrs*,
LocalTime3dCrs*,
MdDatum*,
Model*,
NonSealedSurfaceFrameworkRepresentation*,
Expand Down
16 changes: 8 additions & 8 deletions cmake/swigJavaInclude.i
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ Basically this file add methods resqml2_0_instantiate* which will create the rig
HORIZONINTERPRETATION,
IJKGRIDREPRESENTATION,
LOCALDEPTH3DCRS,
LOCALENGINEERING2DCRS,
LOCALENGINEERINGCOMPOUNDCRS,
LOCALTIME3DCRS,
LOG,
MDDATUM,
Expand Down Expand Up @@ -103,6 +105,7 @@ Basically this file add methods resqml2_0_instantiate* which will create the rig
TRIANGULATEDSETREPRESENTATION,
TRUNCATEDIJKGRIDREPRESENTATION,
UNSTRUCTUREDGRIDREPRESENTATION,
VERTICALCRS,
WELL,
WELLBORE,
WELLBORECOMPLETION,
Expand Down Expand Up @@ -897,14 +900,14 @@ ${COMMENT_END}
case GENERICFEATUREINTERPRETATION : return resqml2_instantiateGenericFeatureInterpretation(cPtr, owner);
case GEOLOGICUNITFEATURE : return new com.f2i_consulting.fesapi.${FESAPI_RESQML2_0_1_NS}.Resqml20_GeologicUnitFeature(cPtr, owner);
case STRATIGRAPHICOCCURRENCEINTERPRETATION : return resqml2_instantiateStratigraphicOccurrenceInterpretation(cPtr, owner);
${COMMENT_START}
case GRAPHICALINFORMATIONSET : return new com.f2i_consulting.fesapi.${FESAPI_EML2_3_NS}.Eml23_GraphicalInformationSet(cPtr, owner);
${COMMENT_END}
case GRID2DREPRESENTATION : return resqml2_instantiateGrid2dRepresentation(cPtr, owner);
case GRIDCONNECTIONSETREPRESENTATION : return resqml2_instantiateGridConnectionSetRepresentation(cPtr, owner);
case HORIZONINTERPRETATION : return resqml2_instantiateHorizonInterpretation(cPtr, owner);
case IJKGRIDREPRESENTATION : return resqml2_instantiateConcreteIjkGridRepresentation(cPtr, owner);
case LOCALDEPTH3DCRS : return new com.f2i_consulting.fesapi.${FESAPI_RESQML2_0_1_NS}.Resqml20_LocalDepth3dCrs(cPtr, owner);
case LOCALENGINEERING2DCRS : return new com.f2i_consulting.fesapi.${FESAPI_EML2_3_NS}.Eml23_LocalEngineering2dCrs(cPtr, owner);
case LOCALENGINEERINGCOMPOUNDCRS : return new com.f2i_consulting.fesapi.${FESAPI_EML2_3_NS}.Eml23_LocalEngineeringCompoundCrs(cPtr, owner);
case LOCALTIME3DCRS : return new com.f2i_consulting.fesapi.${FESAPI_RESQML2_0_1_NS}.Resqml20_LocalTime3dCrs(cPtr, owner);
case LOG : return new com.f2i_consulting.fesapi.${FESAPI_WITSML2_1_NS}.Witsml21_Log(cPtr, owner);
case MDDATUM : return new com.f2i_consulting.fesapi.${FESAPI_RESQML2_0_1_NS}.Resqml20_MdDatum(cPtr, owner);
Expand Down Expand Up @@ -952,6 +955,7 @@ ${COMMENT_END}
case TRIANGULATEDSETREPRESENTATION : return resqml2_instantiateTriangulatedSetRepresentation(cPtr, owner);
case TRUNCATEDIJKGRIDREPRESENTATION : return resqml2_instantiateConcreteIjkGridRepresentation(cPtr, owner);
case UNSTRUCTUREDGRIDREPRESENTATION : return resqml2_instantiateUnstructuredGridRepresentation(cPtr, owner);
case VERTICALCRS : return new com.f2i_consulting.fesapi.${FESAPI_EML2_3_NS}.Eml23_VerticalCrs(cPtr, owner);
case WELL : return new com.f2i_consulting.fesapi.${FESAPI_WITSML2_1_NS}.Witsml21_Well(cPtr, owner);
case WELLBORE : return new com.f2i_consulting.fesapi.${FESAPI_WITSML2_1_NS}.Witsml21_Wellbore(cPtr, owner);
case WELLBORECOMPLETION : return new com.f2i_consulting.fesapi.${FESAPI_WITSML2_1_NS}.Witsml21_WellboreCompletion(cPtr, owner);
Expand Down Expand Up @@ -983,10 +987,8 @@ namespace COMMON_NS

namespace EML2_NS
{
%typemap(javaout) Activity*, ActivityTemplate*, EpcExternalPartReference*, PropertyKind*, TimeSeries*
#ifdef WITH_RESQML2_2
%typemap(javaout) Activity*, ActivityTemplate*, EpcExternalPartReference*, PropertyKind*, TimeSeries*, AbstractLocal3dCrs*
,GraphicalInformationSet*
#endif
{
long cPtr = $jnicall;
$javaclassname ret = ($javaclassname) fesapiJNI.eml2_instantiateConcreteObject(cPtr, $owner);
Expand Down Expand Up @@ -1014,7 +1016,7 @@ namespace WITSML2_NS

namespace RESQML2_NS
{
%typemap(javaout) AbstractFeature*, AbstractFeatureInterpretation*, AbstractRepresentation*, AbstractGridRepresentation*, AbstractLocal3dCrs*,
%typemap(javaout) AbstractFeature*, AbstractFeatureInterpretation*, AbstractRepresentation*, AbstractGridRepresentation*,
AbstractProperty*, AbstractValuesProperty*,
AbstractIjkGridRepresentation*, AbstractStratigraphicOrganizationInterpretation*,
#ifdef WITH_RESQML2_2
Expand Down Expand Up @@ -1054,8 +1056,6 @@ namespace RESQML2_NS
IjkGridLatticeRepresentation*,
IjkGridNoGeometryRepresentation*,
IjkGridParametricRepresentation*,
LocalDepth3dCrs*,
LocalTime3dCrs*,
MdDatum*,
Model*,
NonSealedSurfaceFrameworkRepresentation*,
Expand Down
52 changes: 32 additions & 20 deletions example/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ under the License.
#include "eml2/PropertyKind.h"
#include "eml2/TimeSeries.h"

#include "eml2_3/LocalEngineeringCompoundCrs.h"
#include "eml2_3/PropertyKind.h"

#include "witsml2_1/Well.h"
Expand All @@ -130,6 +131,8 @@ under the License.

using namespace std;

EML2_NS::AbstractLocal3dCrs* local3dCrs = nullptr;
EML2_NS::AbstractLocal3dCrs* localTime3dCrs = nullptr;
EML2_NS::PropertyKind* propType1 = nullptr;
EML2_NS::PropertyKind* pwls3Length = nullptr;

Expand All @@ -150,8 +153,6 @@ RESQML2_NS::TriangulatedSetRepresentation* xPlusFrontierRep = nullptr;
RESQML2_NS::TriangulatedSetRepresentation* yMinusFrontierRep = nullptr;
RESQML2_NS::TriangulatedSetRepresentation* yPlusFrontierRep = nullptr;
RESQML2_NS::WellboreTrajectoryRepresentation* w1i1TrajRep = nullptr;
RESQML2_NS::LocalDepth3dCrs* local3dCrs = nullptr;
RESQML2_NS::LocalTime3dCrs* localTime3dCrs = nullptr;
RESQML2_NS::WellboreFeature* wellbore1 = nullptr;
RESQML2_NS::WellboreInterpretation* wellbore1Interp1 = nullptr;
RESQML2_NS::StratigraphicColumnRankInterpretation* stratiColumnRank0 = nullptr;
Expand All @@ -170,10 +171,20 @@ WITSML2_1_NS::WellboreMarker* witsmlWellboreMarker = nullptr;

void serializeWitsmlWells(COMMON_NS::DataObjectRepository * repo)
{
EML2_3_NS::LocalEngineeringCompoundCrs* eml23Crs = dynamic_cast<EML2_3_NS::LocalEngineeringCompoundCrs*>(local3dCrs);
if (eml23Crs == nullptr) {
repo->setDefaultStandard(COMMON_NS::DataObjectRepository::EnergisticsStandard::EML2_3);
eml23Crs = static_cast<EML2_3_NS::LocalEngineeringCompoundCrs*>
(repo->createLocalDepth3dCrs("", "Local engineering compound CRS", .0, .0, .0, .0, gsoap_resqml2_0_1::eml20__LengthUom::m, 23031, gsoap_resqml2_0_1::eml20__LengthUom::m, "Unknown", false));
repo->setDefaultStandard(COMMON_NS::DataObjectRepository::EnergisticsStandard::EML2_0);
}

// WELL
witsmlWell = repo->createWell("704a287c-5c24-4af3-a97b-bc6670f4e14f", "Well1", false);
witsmlWell->setNameLegal("Legal Name");
witsmlWell->pushBackLocation(275, 75);
witsmlWell->pushBackLocation(275, 75, eml23Crs->getLocalEngineering2dCrs());
witsmlWell->setWellheadElevation(15, gsoap_eml2_3::eml23__LengthUom::m, eml23Crs->getVerticalCrs());
witsmlWell->setGroundElevation(.0, gsoap_eml2_3::eml23__LengthUom::m, eml23Crs->getVerticalCrs());

// WELLBORE
witsmlWellbore = repo->createWellbore(witsmlWell, "3bd60188-5688-43df-89bb-935fe86a813f", "Wellbore1", false);
Expand Down Expand Up @@ -263,7 +274,7 @@ void serializeWells(COMMON_NS::DataObjectRepository * repo, EML2_NS::AbstractHdf
wellbore1Interp1 = repo->createWellboreInterpretation(wellbore1, "dc7840fe-e5a3-4b53-a1df-18040bc4d0c0", "Wellbore1 Interp1", false);

// Representation
RESQML2_NS::MdDatum* mdInfo = repo->createMdDatum("36e91de5-7833-4b6d-90d0-1d643c0adece", "md Info", local3dCrs, gsoap_eml2_3::eml23__ReferencePointKind::mean_x0020sea_x0020level, 275, 75, 0);
RESQML2_NS::MdDatum* mdInfo = repo->createMdDatum("36e91de5-7833-4b6d-90d0-1d643c0adece", "md Info", local3dCrs, gsoap_eml2_3::eml23__ReferencePointKind::mean_x0020sea_x0020level, 275, 75, 15);

//Geometry
w1i1TrajRep = repo->createWellboreTrajectoryRepresentation(wellbore1Interp1, "acd2cdcf-bb5d-48da-bd0e-9aeff3e52180", "Wellbore1 Interp1 TrajRep", mdInfo);
Expand Down Expand Up @@ -2396,7 +2407,7 @@ void deserializeActivity(COMMON_NS::AbstractObject const * resqmlObject)
}
}
else if (activity->isAnIntegerQuantityParameter(paramTitle)) {
vector<int32_t> vals = activity->getIntegerQuantityParameterValue(paramTitle);
vector<int64_t> vals = activity->getIntegerQuantityParameterValue(paramTitle);
for (size_t k = 0; k < vals.size(); ++k) {
cout << "Integer value : " << vals[k] << endl;
}
Expand All @@ -2414,7 +2425,7 @@ void deserializeActivity(COMMON_NS::AbstractObject const * resqmlObject)
}
}
else {
const vector<unsigned int> & paramIndex = activity->getParameterIndexOfTitle(paramTitle);
const vector<uint64_t> & paramIndex = activity->getParameterIndexOfTitle(paramTitle);
for (size_t k = 0; k < paramIndex.size(); ++k) {
if (activity->isAFloatingPointQuantityParameter(paramIndex[k]))
cout << "Floating Point value : " << activity->getFloatingPointQuantityParameterValue(paramIndex[k]);
Expand Down Expand Up @@ -5059,21 +5070,22 @@ void deserialize(const string & inputFile)
cout << "m (meter) == " << enumStrMapper.getEnergisticsUnitOfMeasureName(enumStrMapper.getEnergisticsUnitOfMeasure("m")) << endl;

cout << "CRS" << endl;
vector<RESQML2_NS::LocalDepth3dCrs*> depthCrsSet = repo.getLocalDepth3dCrsSet();
for (size_t i = 0; i < depthCrsSet.size(); ++i) {
cout << "Title is : " << depthCrsSet[i]->getTitle() << endl;
if (depthCrsSet[i]->isProjectedCrsDefinedWithEpsg())
cout << "Projected : EPSG " << depthCrsSet[i]->getProjectedCrsEpsgCode() << endl;
else if (depthCrsSet[i]->isProjectedCrsUnknown())
cout << "Projected : Unknown." << "Reason is:" << depthCrsSet[i]->getProjectedCrsUnknownReason() << endl;
}
vector<RESQML2_NS::LocalTime3dCrs*> timeCrsSet = repo.getLocalTime3dCrsSet();
for (size_t i = 0; i < timeCrsSet.size(); ++i) {
cout << "Title is : " << timeCrsSet[i]->getTitle() << endl;
if (timeCrsSet[i]->isVerticalCrsDefinedWithEpsg())
vector<EML2_NS::AbstractLocal3dCrs*> crsSet = repo.getLocal3dCrsSet();
for (auto* crs : crsSet) {
cout << "Title is : " << crs->getTitle() << endl;
if (crs->isProjectedCrsDefinedWithEpsg())
cout << "Projected : EPSG " << crs->getProjectedCrsEpsgCode() << endl;
else if (crs->isProjectedCrsUnknown())
cout << "Projected : Unknown." << "Reason is:" << crs->getProjectedCrsUnknownReason() << endl;

if (crs->isVerticalCrsDefinedWithEpsg())
cout << "Vertical : EPSG one" << endl;
else if (timeCrsSet[i]->isVerticalCrsUnknown())
cout << "Vertical : Unknown." << "Reason is:" << timeCrsSet[i]->getVerticalCrsUnknownReason() << endl;
else if (crs->isVerticalCrsUnknown())
cout << "Vertical : Unknown." << "Reason is:" << crs->getVerticalCrsUnknownReason() << endl;

if (crs->isATimeCrs()) {
cout << "Time Unit of measure is : " << crs->getTimeUomAsString() << endl;
}
}
cout << endl;

Expand Down
63 changes: 23 additions & 40 deletions src/common/AbstractObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,86 +713,69 @@ void AbstractObject::addAlias(const std::string & authority, const std::string &
}
}

unsigned int AbstractObject::getAliasCount() const
uint64_t AbstractObject::getAliasCount() const
{
cannotBePartial();
if (isPartial()) {
throw invalid_argument("The wrapped gsoap proxy must not be null");
}

size_t count = 0;

if (gsoapProxy2_0_1 != nullptr) {
count = gsoapProxy2_0_1->Aliases.size();
}
else if (gsoapProxy2_3 != nullptr) {
count = gsoapProxy2_3->Aliases.size();
}

if (count > (std::numeric_limits<unsigned int>::max)()) {
throw range_error("There is too much aliases for fesapi.");
}

return static_cast<unsigned int>(count);
return count;
}

std::string AbstractObject::getAliasAuthorityAtIndex(unsigned int index) const
std::string AbstractObject::getAliasAuthorityAtIndex(uint64_t index) const
{
cannotBePartial();

if (getAliasCount() <= index) {
throw out_of_range("The index is out of range.");
}
if (isPartial())
throw invalid_argument("The wrapped gsoap proxy must not be null");

if (gsoapProxy2_0_1 != nullptr) {
return (gsoapProxy2_0_1->Aliases)[index]->authority? *((gsoapProxy2_0_1->Aliases)[index]->authority): std::string();
return (gsoapProxy2_0_1->Aliases).at(index)->authority
? *((gsoapProxy2_0_1->Aliases).at(index)->authority)
: "";
}
else if (gsoapProxy2_3 != nullptr) {
return gsoapProxy2_3->Aliases[index]->authority;
return gsoapProxy2_3->Aliases.at(index)->authority;
}

throw invalid_argument("No underlying gsoap proxy.");
}

std::string AbstractObject::getAliasTitleAtIndex(unsigned int index) const
std::string AbstractObject::getAliasTitleAtIndex(uint64_t index) const
{
cannotBePartial();

if (getAliasCount() <= index)
throw out_of_range("The index is out of range.");
if (isPartial())
throw invalid_argument("The wrapped gsoap proxy must not be null");

if (gsoapProxy2_0_1 != nullptr) {
return (gsoapProxy2_0_1->Aliases)[index]->Identifier;
return (gsoapProxy2_0_1->Aliases).at(index)->Identifier;
}
else if (gsoapProxy2_3 != nullptr) {
return gsoapProxy2_3->Aliases[index]->Identifier;
return gsoapProxy2_3->Aliases.at(index)->Identifier;
}

throw invalid_argument("No underlying gsoap proxy.");
}

std::vector<EML2_NS::Activity *> AbstractObject::getActivitySet() const
std::vector<EML2_NS::Activity*> AbstractObject::getActivitySet() const
{
return getRepository()->getSourceObjects<EML2_NS::Activity>(this);
}

unsigned int AbstractObject::getActivityCount() const
uint64_t AbstractObject::getActivityCount() const
{
const size_t result = getActivitySet().size();

if (result > (std::numeric_limits<unsigned int>::max)()) {
throw out_of_range("There are too many associated activities.");
}

return static_cast<unsigned int>(result);
return getActivitySet().size();
}

EML2_NS::Activity * AbstractObject::getActivity(unsigned int index) const
EML2_NS::Activity* AbstractObject::getActivity(uint64_t index) const
{
cannotBePartial();

const std::vector<EML2_NS::Activity *>& activites = getActivitySet();
if (index >= activites.size())
throw out_of_range("The index is out of range.");

return activites[index];
return getActivitySet().at(index);
}

void AbstractObject::pushBackExtraMetadata(const std::string & key, const std::string & value)
Expand Down
Loading

0 comments on commit ad5c0ce

Please sign in to comment.