21#include <unordered_map>
25#include "../proxies/gsoap_witsml1_4H.h"
27#include "DataObjectRepository.h"
36 enum hdfDatatypeEnum { UNKNOWN = 0, DOUBLE = 1, FLOAT = 2, LONG_64 = 3, ULONG_64 = 4, INT = 5, UINT = 6, SHORT = 7, USHORT = 8, CHAR = 9, UCHAR = 10};
49 DLL_IMPORT_OR_EXPORT
virtual bool isTopLevelElement()
const {
return true; }
60 DLL_IMPORT_OR_EXPORT std::string
getUuid()
const;
71 DLL_IMPORT_OR_EXPORT std::string
getTitle()
const;
205 DLL_IMPORT_OR_EXPORT
void setTitle(
const std::string & title);
217 DLL_IMPORT_OR_EXPORT
void setEditor(
const std::string & editor);
301 DLL_IMPORT_OR_EXPORT
static void setFormat(
const std::string & vendor,
const std::string & applicationName,
const std::string & applicationVersionNumber);
325 DLL_IMPORT_OR_EXPORT
void setVersion(
const std::string & version);
353 DLL_IMPORT_OR_EXPORT
void setMetadata(
const std::string & title,
const std::string & editor, time_t creation,
const std::string & originator,
354 const std::string & description, time_t lastUpdate,
const std::string & descriptiveKeywords);
371 gsoap_resqml2_0_1::eml20__AbstractCitedDataObject*
getEml20GsoapProxy()
const {
return gsoapProxy2_0_1; }
377 void setGsoapProxy(gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* gsoapProxy) { gsoapProxy2_0_1 = gsoapProxy; }
390 void setGsoapProxy(gsoap_eml2_1::eml21__AbstractObject* gsoapProxy) { gsoapProxy2_1 = gsoapProxy; }
403 void setGsoapProxy(gsoap_eml2_2::eml22__AbstractObject* gsoapProxy) { gsoapProxy2_2 = gsoapProxy; }
416 void setGsoapProxy(gsoap_eml2_3::eml23__AbstractObject* gsoapProxy) { gsoapProxy2_3 = gsoapProxy; }
446 DLL_IMPORT_OR_EXPORT gsoap_eml2_1::eml21__DataObjectReference*
newEmlReference()
const;
481 DLL_IMPORT_OR_EXPORT COMMON_NS::DataObjectRepository*
getRepository()
const {
return repository;}
495 DLL_IMPORT_OR_EXPORT
virtual std::string
getXmlTag()
const = 0;
542 DLL_IMPORT_OR_EXPORT
void addAlias(
const std::string & authority,
const std::string & title);
609 DLL_IMPORT_OR_EXPORT EML2_NS::Activity*
getActivity(
unsigned int index)
const;
639 DLL_IMPORT_OR_EXPORT std::vector<std::string>
getExtraMetadata(
const std::string & key)
const;
688 gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject;
691 gsoap_witsml1_4::witsml14__obj_USCOREtrajectory* gsoapProxyTraj1_4;
694 gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* gsoapProxy2_0_1;
697 gsoap_eml2_1::eml21__AbstractObject* gsoapProxy2_1;
700 gsoap_eml2_2::eml22__AbstractObject* gsoapProxy2_2;
703 gsoap_eml2_3::eml23__AbstractObject* gsoapProxy2_3;
706 COMMON_NS::DataObjectRepository* repository;
712 partialObject(nullptr), gsoapProxyTraj1_4(nullptr),
713 gsoapProxy2_0_1(nullptr),
714 gsoapProxy2_1(nullptr),
715 gsoapProxy2_2(nullptr),
716 gsoapProxy2_3(nullptr),
717 repository(nullptr) {}
724 AbstractObject(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject_) :
725 partialObject(partialObject_), gsoapProxyTraj1_4(nullptr),
726 gsoapProxy2_0_1(nullptr),
727 gsoapProxy2_1(nullptr),
728 gsoapProxy2_2(nullptr),
729 gsoapProxy2_3(nullptr),
730 repository(nullptr) {}
731 AbstractObject(
const DataObjectReference& dor) :
732 partialObject(dor.toDor20()), gsoapProxyTraj1_4(nullptr),
733 gsoapProxy2_0_1(nullptr),
734 gsoapProxy2_1(nullptr),
735 gsoapProxy2_2(nullptr),
736 gsoapProxy2_3(nullptr),
737 repository(nullptr) {}
744 AbstractObject(gsoap_witsml1_4::witsml14__obj_USCOREtrajectory* proxy) :
745 partialObject(nullptr), gsoapProxyTraj1_4(proxy),
746 gsoapProxy2_0_1(nullptr),
747 gsoapProxy2_1(nullptr),
748 gsoapProxy2_2(nullptr),
749 gsoapProxy2_3(nullptr),
750 repository(nullptr) {}
757 AbstractObject(gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* proxy) :
758 partialObject(nullptr), gsoapProxyTraj1_4(nullptr),
759 gsoapProxy2_0_1(proxy),
760 gsoapProxy2_1(nullptr),
761 gsoapProxy2_2(nullptr),
762 gsoapProxy2_3(nullptr),
763 repository(nullptr) {}
770 AbstractObject(gsoap_eml2_1::eml21__AbstractObject* proxy) :
771 partialObject(nullptr), gsoapProxyTraj1_4(nullptr),
772 gsoapProxy2_0_1(nullptr),
773 gsoapProxy2_1(proxy),
774 gsoapProxy2_2(nullptr),
775 gsoapProxy2_3(nullptr),
776 repository(nullptr) {}
783 AbstractObject(gsoap_eml2_2::eml22__AbstractObject* proxy) :
784 partialObject(nullptr), gsoapProxyTraj1_4(nullptr),
785 gsoapProxy2_0_1(nullptr),
786 gsoapProxy2_1(nullptr),
787 gsoapProxy2_2(proxy),
788 gsoapProxy2_3(nullptr),
789 repository(nullptr) {}
796 AbstractObject(gsoap_eml2_3::eml23__AbstractObject* proxy) :
797 partialObject(nullptr), gsoapProxyTraj1_4(nullptr),
798 gsoapProxy2_0_1(nullptr),
799 gsoapProxy2_1(nullptr),
800 gsoapProxy2_2(nullptr),
801 gsoapProxy2_3(proxy),
802 repository(nullptr) {}
805 friend bool COMMON_NS::DataObjectRepository::addDataObject(COMMON_NS::AbstractObject* proxy);
806 friend COMMON_NS::AbstractObject* COMMON_NS::DataObjectRepository::addOrReplaceDataObject(AbstractObject* proxy,
bool replaceOnlyContent);
812 void initMandatoryMetadata();
830 void setMetadata(
const std::string & guid,
const std::string & title,
const std::string & editor, time_t creation,
const std::string & originator,
831 const std::string & description, time_t lastUpdate,
const std::string & descriptiveKeywords);
834 void cannotBePartial()
const;
837 void changeToPartialObject();
846 void readArrayNdOfDoubleValues(gsoap_resqml2_0_1::resqml20__AbstractDoubleArray * arrayInput,
double * arrayOutput)
const;
855 void readArrayNdOfDoubleValues(gsoap_eml2_3::eml23__AbstractFloatingPointArray * arrayInput,
double * arrayOutput)
const;
858 void readArrayNdOfNonHdf5IntegerValues(gsoap_resqml2_0_1::resqml20__AbstractIntegerArray
const * arrayInput, T * arrayOutput)
const {
859 switch (arrayInput->soap_type()) {
860 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerRangeArray:
862 gsoap_resqml2_0_1::resqml20__IntegerRangeArray
const* rangeArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerRangeArray
const *
>(arrayInput);
863 if (rangeArray->Value + rangeArray->Count > (std::numeric_limits<T>::max)()) {
864 throw std::range_error(
"The range integer values are superior to unsigned int maximum value.");
866 for (
unsigned int i = 0; i < static_cast<T>(rangeArray->Count); ++i) {
867 arrayOutput[i] = i +
static_cast<T
>(rangeArray->Value);
871 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerConstantArray:
873 gsoap_resqml2_0_1::resqml20__IntegerConstantArray
const* constantArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerConstantArray const*
>(arrayInput);
874 if (constantArray->Value > (std::numeric_limits<T>::max)()) {
875 throw std::range_error(
"The constant integer value is superior to unsigned int maximum value.");
877 for (
size_t i = 0; i < constantArray->Count; ++i) {
878 arrayOutput[i] =
static_cast<T
>(constantArray->Value);
882 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerLatticeArray:
884 gsoap_resqml2_0_1::resqml20__IntegerLatticeArray
const* latticeArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const*
>(arrayInput);
885 if (latticeArray->Offset.size() > 1) {
886 throw std::invalid_argument(
"The integer lattice array contains more than one offset.");
888 for (
size_t i = 0; i <= latticeArray->Offset[0]->Count; ++i) {
889 arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
894 throw std::invalid_argument(
"The integer array type is not supported yet.");
899 void readArrayNdOfNonHdf5IntegerValues(gsoap_eml2_3::eml23__AbstractIntegerArray
const * arrayInput, T * arrayOutput)
const {
900 switch (arrayInput->soap_type()) {
901 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerRangeArray:
903 gsoap_eml2_3::eml23__IntegerRangeArray
const* rangeArray =
static_cast<gsoap_eml2_3::eml23__IntegerRangeArray const*
>(arrayInput);
904 if (rangeArray->Value + rangeArray->Count > (std::numeric_limits<T>::max)()) {
905 throw std::range_error(
"The range integer values are superior to unsigned int maximum value.");
907 for (
unsigned int i = 0; i < static_cast<T>(rangeArray->Count); ++i) {
908 arrayOutput[i] = i +
static_cast<T
>(rangeArray->Value);
912 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerConstantArray:
914 gsoap_eml2_3::eml23__IntegerConstantArray
const* constantArray =
static_cast<gsoap_eml2_3::eml23__IntegerConstantArray const*
>(arrayInput);
915 if (constantArray->Value > (std::numeric_limits<T>::max)()) {
916 throw std::range_error(
"The constant integer value is superior to unsigned int maximum value.");
918 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
921 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerLatticeArray:
923 gsoap_eml2_3::eml23__IntegerLatticeArray
const* latticeArray =
static_cast<gsoap_eml2_3::eml23__IntegerLatticeArray const*
>(arrayInput);
924 if (latticeArray->Offset.size() > 1) {
925 throw std::invalid_argument(
"The integer lattice array contains more than one offset.");
927 for (
size_t i = 0; i <= latticeArray->Offset[0]->Count; ++i) {
928 arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
932 default:
throw std::invalid_argument(
"The integer array type is not supported yet.");
945 uint8_t readArrayNdOfUInt8Values(gsoap_resqml2_0_1::resqml20__AbstractIntegerArray
const * arrayInput, uint8_t * arrayOutput)
const;
956 uint8_t readArrayNdOfUInt8Values(gsoap_eml2_3::eml23__AbstractIntegerArray
const * arrayInput, uint8_t * arrayOutput)
const;
967 uint16_t readArrayNdOfUInt16Values(gsoap_resqml2_0_1::resqml20__AbstractIntegerArray
const * arrayInput, uint16_t * arrayOutput)
const;
978 uint16_t readArrayNdOfUInt16Values(gsoap_eml2_3::eml23__AbstractIntegerArray
const * arrayInput, uint16_t * arrayOutput)
const;
989 uint32_t readArrayNdOfUInt32Values(gsoap_resqml2_0_1::resqml20__AbstractIntegerArray
const * arrayInput, uint32_t * arrayOutput)
const;
1000 uint32_t readArrayNdOfUInt32Values(gsoap_eml2_3::eml23__AbstractIntegerArray
const * arrayInput, uint32_t * arrayOutput)
const;
1011 uint64_t readArrayNdOfUInt64Values(gsoap_resqml2_0_1::resqml20__AbstractIntegerArray
const * arrayInput, uint64_t * arrayOutput)
const;
1022 uint64_t readArrayNdOfUInt64Values(gsoap_eml2_3::eml23__AbstractIntegerArray
const * arrayInput, uint64_t * arrayOutput)
const;
1033 int64_t readArrayNdOfInt64Values(gsoap_resqml2_0_1::resqml20__AbstractIntegerArray
const * arrayInput, int64_t * arrayOutput)
const;
1044 int64_t readArrayNdOfInt64Values(gsoap_eml2_3::eml23__AbstractIntegerArray
const * arrayInput, int64_t * arrayOutput)
const;
1053 uint64_t getCountOfIntegerArray(gsoap_resqml2_0_1::resqml20__AbstractIntegerArray * arrayInput)
const;
1062 uint64_t getCountOfIntegerArray(gsoap_eml2_3::eml23__AbstractIntegerArray * arrayInput)
const;
1069 void convertDorIntoRel(
const DataObjectReference& dor);
1080 template <
class valueType>
1081 void convertDorIntoRel(
const DataObjectReference& dor)
1083 valueType * targetObj = getRepository()->getDataObjectByUuid<valueType>(dor.getUuid());
1084 if (targetObj ==
nullptr) {
1085 getRepository()->createPartial(dor);
1086 targetObj = getRepository()->getDataObjectByUuid<valueType>(dor.getUuid());
1087 if (targetObj ==
nullptr) {
1088 throw std::invalid_argument(
"The DOR looks invalid.");
1091 getRepository()->addRelationship(
this, targetObj);
1105 EML2_NS::AbstractHdfProxy* getHdfProxyFromDataset(gsoap_resqml2_0_1::eml20__Hdf5Dataset
const * dataset,
bool throwException =
true)
const;
1118 EML2_NS::AbstractHdfProxy* getHdfProxyFromDataset(gsoap_eml2_3::eml23__ExternalDatasetPart
const * dataset,
bool throwException =
true)
const;
1123 std::string getHdfGroup()
const {
1124 return "/" + getXmlNamespace() +
"/" + getUuid();
1127 gsoap_resqml2_0_1::resqml20__IndexableElements mapIndexableElement(gsoap_eml2_3::resqml22__IndexableElement toMap)
const;
1131 static char citationFormat[];
1140 void setUuid(
const std::string & uuid);
An abstract data object.
Definition: AbstractObject.h:33
gsoap_eml2_2::eml22__DataObjectReference * newEml22Reference() const
soap * getGsoapContext() const
gsoap_eml2_1::eml21__DataObjectReference * newEmlReference() const
void setGsoapProxy(gsoap_eml2_2::eml22__AbstractObject *gsoapProxy)
Definition: AbstractObject.h:403
void setCreation(const tm &creation)
void setGsoapProxy(gsoap_eml2_3::eml23__AbstractObject *gsoapProxy)
Definition: AbstractObject.h:416
void setVersion(const std::string &version)
unsigned int getAliasCount() const
std::string getVersion() const
virtual std::string getContentType() const
void setTitle(const std::string &title)
std::unordered_map< std::string, std::string > getExtraMetadataSet() const
time_t getCreation() const
virtual void loadTargetRelationships()=0
std::string getExtraMetadataStringValueAtIndex(unsigned int index) const
gsoap_eml2_3::resqml22__ContactElement * newContactElementReference2_2() const
std::string serializeIntoString()
std::string buildEtp12Uri() const
unsigned int getExtraMetadataCount() const
std::string getDescriptiveKeywords() const
gsoap_resqml2_0_1::eml20__DataObjectReference * newResqmlReference() const
virtual std::string getXmlNamespaceVersion() const
common::DataObjectRepository * getRepository() const
Definition: AbstractObject.h:481
std::string getEditor() const
gsoap_eml2_3::eml23__DataObjectReference * newEml23Reference() const
void setGsoapProxy(gsoap_eml2_1::eml21__AbstractObject *gsoapProxy)
Definition: AbstractObject.h:390
std::string getAliasTitleAtIndex(unsigned int index) const
virtual std::string getQualifiedType() const
void setEditor(const std::string &editor)
void setLastUpdate(time_t lastUpdate)
std::string getUuid() const
std::string getAliasAuthorityAtIndex(unsigned int index) const
void setDescription(const std::string &description)
gsoap_eml2_1::eml21__AbstractObject * getEml21GsoapProxy() const
Definition: AbstractObject.h:384
gsoap_eml2_2::eml22__AbstractObject * getEml22GsoapProxy() const
Definition: AbstractObject.h:397
void serializeIntoStream(std::ostream *stream)
void setDescriptiveKeywords(const std::string &descriptiveKeywords)
virtual std::string getXmlNamespace() const =0
void setCreation(time_t creation)
gsoap_resqml2_0_1::resqml20__ContactElementReference * newContactElementReference2_0_1() const
void pushBackExtraMetadata(const std::string &key, const std::string &value)
void setLastUpdate(const tm &lastUpdate)
eml2::Activity * getActivity(unsigned int index) const
gsoap_resqml2_0_1::eml20__AbstractCitedDataObject * getEml20GsoapProxy() const
Definition: AbstractObject.h:371
gsoap_eml2_3::eml23__AbstractObject * getEml23GsoapProxy() const
Definition: AbstractObject.h:410
std::vector< std::string > getExtraMetadata(const std::string &key) const
std::string getOriginator() const
void setGsoapProxy(gsoap_resqml2_0_1::eml20__AbstractCitedDataObject *gsoapProxy)
Definition: AbstractObject.h:377
tm getCreationAsTimeStructure() const
tm getLastUpdateAsTimeStructure() const
void setMetadata(const std::string &title, const std::string &editor, time_t creation, const std::string &originator, const std::string &description, time_t lastUpdate, const std::string &descriptiveKeywords)
void setOriginator(const std::string &originator)
virtual std::string getPartNameInEpcDocument() const
std::string getDescription() const
time_t getLastUpdate() const
static void setFormat(const std::string &vendor, const std::string &applicationName, const std::string &applicationVersionNumber)
virtual std::string getXmlTag() const =0
void addAlias(const std::string &authority, const std::string &title)
unsigned int getActivityCount() const
std::string getTitle() const
std::vector< eml2::Activity * > getActivitySet() const
std::string getFormat() const
std::string getExtraMetadataKeyAtIndex(unsigned int index) const