36 enum class numericalDatatypeEnum { UNKNOWN = 0, DOUBLE = 1, FLOAT = 2, INT64 = 3, UINT64 = 4, INT32 = 5, UINT32 = 6, INT16 = 7, UINT16 = 8, INT8 = 9, UINT8 = 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_3::eml23__AbstractObject* gsoapProxy) { gsoapProxy2_3 = gsoapProxy; }
441 DLL_IMPORT_OR_EXPORT COMMON_NS::DataObjectRepository*
getRepository()
const {
return repository;}
455 DLL_IMPORT_OR_EXPORT
virtual std::string
getXmlTag()
const = 0;
502 DLL_IMPORT_OR_EXPORT
void addAlias(
const std::string & authority,
const std::string & title);
567 DLL_IMPORT_OR_EXPORT EML2_NS::Activity*
getActivity(uint64_t index)
const;
597 DLL_IMPORT_OR_EXPORT std::vector<std::string>
getExtraMetadata(
const std::string & key)
const;
638 std::string tmp = uriSource_.empty() ?
"eml:///" : uriSource_;
639 return (tmp.back() ==
'/' ? tmp : tmp +
'/') + getQualifiedType() +
'(' + getUuid() +
')';
645 DLL_IMPORT_OR_EXPORT
void setUriSource(
const std::string & uriSource) { uriSource_ = uriSource; }
650 DLL_IMPORT_OR_EXPORT
const std::string&
getUriSource()
const {
return uriSource_; }
657 if (uriSource_.find(
".epc") != uriSource_.size() - 4 &&
658 uriSource_.find(
".EPC") != uriSource_.size() - 4) {
662 const size_t slashPos = uriSource_.find_last_of(
"/\\");
663 return slashPos != std::string::npos ? uriSource_.substr(0, slashPos + 1) :
"";
679 gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject;
682 gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* gsoapProxy2_0_1;
685 gsoap_eml2_3::eml23__AbstractObject* gsoapProxy2_3;
688 COMMON_NS::DataObjectRepository* repository;
694 partialObject(nullptr),
695 gsoapProxy2_0_1(nullptr),
696 gsoapProxy2_3(nullptr),
697 repository(nullptr) {}
704 AbstractObject(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject_) :
705 partialObject(partialObject_),
706 gsoapProxy2_0_1(nullptr),
707 gsoapProxy2_3(nullptr),
708 repository(nullptr) {}
709 AbstractObject(
const DataObjectReference& dor) :
710 partialObject(dor.toDor20()),
711 gsoapProxy2_0_1(nullptr),
712 gsoapProxy2_3(nullptr),
713 repository(nullptr) {}
720 AbstractObject(gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* proxy) :
721 partialObject(nullptr),
722 gsoapProxy2_0_1(proxy),
723 gsoapProxy2_3(nullptr),
724 repository(nullptr) {}
731 AbstractObject(gsoap_eml2_3::eml23__AbstractObject* proxy) :
732 partialObject(nullptr),
733 gsoapProxy2_0_1(nullptr),
734 gsoapProxy2_3(proxy),
735 repository(nullptr) {}
738 friend bool COMMON_NS::DataObjectRepository::addDataObject(COMMON_NS::AbstractObject* proxy);
739 friend COMMON_NS::AbstractObject* COMMON_NS::DataObjectRepository::addOrReplaceDataObject(AbstractObject* proxy,
bool replaceOnlyContent);
745 void initMandatoryMetadata();
763 void setMetadata(
const std::string & guid,
const std::string & title,
const std::string & editor, time_t creation,
const std::string & originator,
764 const std::string & description, time_t lastUpdate,
const std::string & descriptiveKeywords);
767 void cannotBePartial()
const;
776 void readArrayNdOfFloatValues(gsoap_resqml2_0_1::resqml20__AbstractDoubleArray
const* arrayInput,
float* arrayOutput)
const;
785 void readArrayNdOfFloatValues(gsoap_eml2_3::eml23__AbstractFloatingPointArray
const* arrayInput,
float* arrayOutput)
const;
794 void readArrayNdOfDoubleValues(gsoap_resqml2_0_1::resqml20__AbstractDoubleArray
const* arrayInput,
double * arrayOutput)
const;
803 void readArrayNdOfDoubleValues(gsoap_eml2_3::eml23__AbstractFloatingPointArray
const* arrayInput,
double * arrayOutput)
const;
806 T readArrayNdOfNonHdf5IntegerValues(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const * arrayInput, T * arrayOutput)
const {
807 switch (arrayInput->soap_type()) {
808 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerRangeArray:
810 gsoap_resqml2_0_1::resqml20__IntegerRangeArray
const* rangeArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerRangeArray
const *
>(arrayInput);
811 if (rangeArray->Value + rangeArray->Count > (std::numeric_limits<T>::max)()) {
812 throw std::range_error(
"The range integer values are superior to maximum value of read datatype.");
814 for (T i = 0; i < static_cast<T>(rangeArray->Count); ++i) {
815 arrayOutput[i] = i +
static_cast<T
>(rangeArray->Value);
817 return (std::numeric_limits<T>::max)();
819 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerConstantArray:
821 gsoap_resqml2_0_1::resqml20__IntegerConstantArray
const* constantArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerConstantArray const*
>(arrayInput);
822 if (
sizeof(constantArray->Value) >
sizeof(T) && constantArray->Value > (std::numeric_limits<T>::max)()) {
823 throw std::range_error(
"The constant integer value is superior to maximum value of read datatype.");
825 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
826 return (std::numeric_limits<T>::max)();
828 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__BooleanConstantArray:
830 gsoap_resqml2_0_1::resqml20__BooleanConstantArray
const* constantArray =
static_cast<gsoap_resqml2_0_1::resqml20__BooleanConstantArray const*
>(arrayInput);
831 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
832 return (std::numeric_limits<T>::max)();
834 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerLatticeArray:
836 gsoap_resqml2_0_1::resqml20__IntegerLatticeArray
const* latticeArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const*
>(arrayInput);
837 if (latticeArray->Offset.size() > 1) {
838 throw std::invalid_argument(
"The integer lattice array contains more than one offset.");
840 for (
size_t i = 0; i <= latticeArray->Offset[0]->Count; ++i) {
841 arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
843 return (std::numeric_limits<T>::max)();
846 throw std::invalid_argument(
"The integer array type is not supported yet.");
851 T readArrayNdOfNonHdf5IntegerValues(gsoap_eml2_3::eml23__AbstractValueArray
const * arrayInput, T * arrayOutput)
const {
852 switch (arrayInput->soap_type()) {
853 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerConstantArray:
855 gsoap_eml2_3::eml23__IntegerConstantArray
const* constantArray =
static_cast<gsoap_eml2_3::eml23__IntegerConstantArray const*
>(arrayInput);
856 if (
sizeof(constantArray->Value) >
sizeof(T) && constantArray->Value > (std::numeric_limits<T>::max)()) {
857 throw std::range_error(
"The constant integer value is superior to maximum value of read datatype.");
859 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
860 return (std::numeric_limits<T>::max)();
862 case SOAP_TYPE_gsoap_eml2_3_eml23__BooleanConstantArray:
864 gsoap_eml2_3::eml23__BooleanConstantArray
const* constantArray =
static_cast<gsoap_eml2_3::eml23__BooleanConstantArray const*
>(arrayInput);
865 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
866 return (std::numeric_limits<T>::max)();
868 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerLatticeArray:
870 gsoap_eml2_3::eml23__IntegerLatticeArray
const* latticeArray =
static_cast<gsoap_eml2_3::eml23__IntegerLatticeArray const*
>(arrayInput);
871 if (latticeArray->Offset.empty() || latticeArray->Offset.size() > 1) {
872 throw std::invalid_argument(
"The integer lattice array of UUID " + getUuid() +
" contains zero or more than one offset.");
874 if (latticeArray->Offset[0]->Count < 0) {
875 throw std::invalid_argument(
"The count of the integer lattice array of UUID " + getUuid() +
" is negative which is not valid.");
878 for (
size_t i = 0; i <= static_cast<size_t>(latticeArray->Offset[0]->Count); ++i) {
879 arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
881 return (std::numeric_limits<T>::max)();
883 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerXmlArray:
885 gsoap_eml2_3::eml23__IntegerXmlArray
const * xmlArray =
static_cast<gsoap_eml2_3::eml23__IntegerXmlArray const*
>(arrayInput);
886 const std::regex ws_re(
"\\s+");
887#if !defined(__GLIBCXX__) || __GLIBCXX__ > 20150623 || __GLIBCXX__ == 20140422 || __GLIBCXX__ == 20140716 || __GLIBCXX__ == 20141030
888 std::sregex_token_iterator it(xmlArray->Values.begin(), xmlArray->Values.end(), ws_re, -1);
889 std::sregex_token_iterator endToken;
891 boost::sregex_token_iterator it(xmlArray->Values.begin(), xmlArray->Values.end(), ws_re, -1);
892 boost::sregex_token_iterator endToken;
895 while (it != endToken) {
896 arrayOutput[index++] = std::stoll(*it++);
898 return (std::numeric_limits<T>::max)();
900 default:
throw std::invalid_argument(
"The integer array type is not supported yet.");
913 void readArrayNdOfBooleanValues(gsoap_eml2_3::eml23__BooleanExternalArray
const * arrayInput, int8_t * arrayOutput)
const;
924 uint8_t readArrayNdOfUInt8Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint8_t * arrayOutput)
const;
935 uint8_t readArrayNdOfUInt8Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint8_t * arrayOutput)
const;
946 uint16_t readArrayNdOfUInt16Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint16_t * arrayOutput)
const;
957 uint16_t readArrayNdOfUInt16Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint16_t * arrayOutput)
const;
968 uint32_t readArrayNdOfUInt32Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint32_t * arrayOutput)
const;
979 uint32_t readArrayNdOfUInt32Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint32_t * arrayOutput)
const;
990 uint64_t readArrayNdOfUInt64Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint64_t * arrayOutput)
const;
1001 uint64_t readArrayNdOfUInt64Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint64_t * arrayOutput)
const;
1012 int8_t readArrayNdOfInt8Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int8_t * arrayOutput)
const;
1023 int8_t readArrayNdOfInt8Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int8_t * arrayOutput)
const;
1034 int16_t readArrayNdOfInt16Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int16_t * arrayOutput)
const;
1045 int16_t readArrayNdOfInt16Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int16_t * arrayOutput)
const;
1056 int32_t readArrayNdOfInt32Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int32_t * arrayOutput)
const;
1067 int32_t readArrayNdOfInt32Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int32_t * arrayOutput)
const;
1078 int64_t readArrayNdOfInt64Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int64_t * arrayOutput)
const;
1089 int64_t readArrayNdOfInt64Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int64_t * arrayOutput)
const;
1098 uint64_t getCountOfArray(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput)
const;
1107 uint64_t getCountOfArray(gsoap_eml2_3::eml23__AbstractValueArray
const * arrayInput)
const;
1114 void convertDorIntoRel(
const DataObjectReference& dor);
1125 template <
class valueType>
1126 void convertDorIntoRel(
const DataObjectReference& dor)
1128 valueType * targetObj = getRepository()->getDataObjectByUuid<valueType>(dor.getUuid());
1129 if (targetObj ==
nullptr) {
1130 getRepository()->createPartial(dor);
1131 targetObj = getRepository()->getDataObjectByUuid<valueType>(dor.getUuid());
1132 if (targetObj ==
nullptr) {
1133 throw std::invalid_argument(
"The DOR looks invalid.");
1135 targetObj->setUriSource(getUriSource());
1137 getRepository()->addRelationship(
this, targetObj);
1151 EML2_NS::AbstractHdfProxy* getHdfProxyFromDataset(gsoap_resqml2_0_1::eml20__Hdf5Dataset
const * dataset,
bool throwException =
true)
const;
1163 EML2_NS::AbstractHdfProxy* getOrCreateHdfProxyFromDataArrayPart(gsoap_eml2_3::eml23__ExternalDataArrayPart
const * dataArrayPart)
const;
1168 std::string getHdfGroup()
const {
1169 return "/" + getXmlNamespace() +
"/" + getUuid();
1175 gsoap_eml2_3::eml23__ExternalDataArrayPart* createExternalDataArrayPart(
const std::string& datasetName, LONG64 count, EML2_NS::AbstractHdfProxy* proxy =
nullptr)
const;
1177 gsoap_resqml2_0_1::resqml20__IndexableElements mapIndexableElement(gsoap_eml2_3::eml23__IndexableElement toMap)
const;
1181 static char citationFormat[];
1186 std::string uriSource_;
1195 void setUuid(
const std::string & uuid);