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);
569 DLL_IMPORT_OR_EXPORT EML2_NS::Activity*
getActivity(
unsigned int index)
const;
599 DLL_IMPORT_OR_EXPORT std::vector<std::string>
getExtraMetadata(
const std::string & key)
const;
640 std::string tmp = uriSource_.empty() ?
"eml:///" : uriSource_;
641 return (tmp.back() ==
'/' ? tmp : tmp +
'/') + getQualifiedType() +
'(' + getUuid() +
')';
647 DLL_IMPORT_OR_EXPORT
void setUriSource(
const std::string & uriSource) { uriSource_ = uriSource; }
652 DLL_IMPORT_OR_EXPORT
const std::string&
getUriSource()
const {
return uriSource_; }
659 if (uriSource_.find(
".epc") != uriSource_.size() - 4 &&
660 uriSource_.find(
".EPC") != uriSource_.size() - 4) {
664 const size_t slashPos = uriSource_.find_last_of(
"/\\");
665 return slashPos != std::string::npos ? uriSource_.substr(0, slashPos + 1) :
"";
681 gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject;
684 gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* gsoapProxy2_0_1;
687 gsoap_eml2_3::eml23__AbstractObject* gsoapProxy2_3;
690 COMMON_NS::DataObjectRepository* repository;
696 partialObject(nullptr),
697 gsoapProxy2_0_1(nullptr),
698 gsoapProxy2_3(nullptr),
699 repository(nullptr) {}
706 AbstractObject(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject_) :
707 partialObject(partialObject_),
708 gsoapProxy2_0_1(nullptr),
709 gsoapProxy2_3(nullptr),
710 repository(nullptr) {}
711 AbstractObject(
const DataObjectReference& dor) :
712 partialObject(dor.toDor20()),
713 gsoapProxy2_0_1(nullptr),
714 gsoapProxy2_3(nullptr),
715 repository(nullptr) {}
722 AbstractObject(gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* proxy) :
723 partialObject(nullptr),
724 gsoapProxy2_0_1(proxy),
725 gsoapProxy2_3(nullptr),
726 repository(nullptr) {}
733 AbstractObject(gsoap_eml2_3::eml23__AbstractObject* proxy) :
734 partialObject(nullptr),
735 gsoapProxy2_0_1(nullptr),
736 gsoapProxy2_3(proxy),
737 repository(nullptr) {}
740 friend bool COMMON_NS::DataObjectRepository::addDataObject(COMMON_NS::AbstractObject* proxy);
741 friend COMMON_NS::AbstractObject* COMMON_NS::DataObjectRepository::addOrReplaceDataObject(AbstractObject* proxy,
bool replaceOnlyContent);
747 void initMandatoryMetadata();
765 void setMetadata(
const std::string & guid,
const std::string & title,
const std::string & editor, time_t creation,
const std::string & originator,
766 const std::string & description, time_t lastUpdate,
const std::string & descriptiveKeywords);
769 void cannotBePartial()
const;
778 void readArrayNdOfFloatValues(gsoap_resqml2_0_1::resqml20__AbstractDoubleArray
const* arrayInput,
float* arrayOutput)
const;
787 void readArrayNdOfFloatValues(gsoap_eml2_3::eml23__AbstractFloatingPointArray
const* arrayInput,
float* arrayOutput)
const;
796 void readArrayNdOfDoubleValues(gsoap_resqml2_0_1::resqml20__AbstractDoubleArray
const* arrayInput,
double * arrayOutput)
const;
805 void readArrayNdOfDoubleValues(gsoap_eml2_3::eml23__AbstractFloatingPointArray
const* arrayInput,
double * arrayOutput)
const;
808 T readArrayNdOfNonHdf5IntegerValues(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const * arrayInput, T * arrayOutput)
const {
809 switch (arrayInput->soap_type()) {
810 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerRangeArray:
812 gsoap_resqml2_0_1::resqml20__IntegerRangeArray
const* rangeArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerRangeArray
const *
>(arrayInput);
813 if (rangeArray->Value + rangeArray->Count > (std::numeric_limits<T>::max)()) {
814 throw std::range_error(
"The range integer values are superior to maximum value of read datatype.");
816 for (T i = 0; i < static_cast<T>(rangeArray->Count); ++i) {
817 arrayOutput[i] = i +
static_cast<T
>(rangeArray->Value);
819 return (std::numeric_limits<T>::max)();
821 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerConstantArray:
823 gsoap_resqml2_0_1::resqml20__IntegerConstantArray
const* constantArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerConstantArray const*
>(arrayInput);
824 if (
sizeof(constantArray->Value) >
sizeof(T) && constantArray->Value > (std::numeric_limits<T>::max)()) {
825 throw std::range_error(
"The constant integer value is superior to maximum value of read datatype.");
827 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
828 return (std::numeric_limits<T>::max)();
830 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__BooleanConstantArray:
832 gsoap_resqml2_0_1::resqml20__BooleanConstantArray
const* constantArray =
static_cast<gsoap_resqml2_0_1::resqml20__BooleanConstantArray const*
>(arrayInput);
833 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
834 return (std::numeric_limits<T>::max)();
836 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerLatticeArray:
838 gsoap_resqml2_0_1::resqml20__IntegerLatticeArray
const* latticeArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const*
>(arrayInput);
839 if (latticeArray->Offset.size() > 1) {
840 throw std::invalid_argument(
"The integer lattice array contains more than one offset.");
842 for (
size_t i = 0; i <= latticeArray->Offset[0]->Count; ++i) {
843 arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
845 return (std::numeric_limits<T>::max)();
848 throw std::invalid_argument(
"The integer array type is not supported yet.");
853 T readArrayNdOfNonHdf5IntegerValues(gsoap_eml2_3::eml23__AbstractValueArray
const * arrayInput, T * arrayOutput)
const {
854 switch (arrayInput->soap_type()) {
855 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerConstantArray:
857 gsoap_eml2_3::eml23__IntegerConstantArray
const* constantArray =
static_cast<gsoap_eml2_3::eml23__IntegerConstantArray const*
>(arrayInput);
858 if (
sizeof(constantArray->Value) >
sizeof(T) && constantArray->Value > (std::numeric_limits<T>::max)()) {
859 throw std::range_error(
"The constant integer value is superior to maximum value of read datatype.");
861 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
862 return (std::numeric_limits<T>::max)();
864 case SOAP_TYPE_gsoap_eml2_3_eml23__BooleanConstantArray:
866 gsoap_eml2_3::eml23__BooleanConstantArray
const* constantArray =
static_cast<gsoap_eml2_3::eml23__BooleanConstantArray const*
>(arrayInput);
867 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
868 return (std::numeric_limits<T>::max)();
870 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerLatticeArray:
872 gsoap_eml2_3::eml23__IntegerLatticeArray
const* latticeArray =
static_cast<gsoap_eml2_3::eml23__IntegerLatticeArray const*
>(arrayInput);
873 if (latticeArray->Offset.empty() || latticeArray->Offset.size() > 1) {
874 throw std::invalid_argument(
"The integer lattice array of UUID " + getUuid() +
" contains zero or more than one offset.");
876 if (latticeArray->Offset[0]->Count < 0) {
877 throw std::invalid_argument(
"The count of the integer lattice array of UUID " + getUuid() +
" is negative which is not valid.");
880 for (
size_t i = 0; i <= static_cast<size_t>(latticeArray->Offset[0]->Count); ++i) {
881 arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
883 return (std::numeric_limits<T>::max)();
885 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerXmlArray:
887 gsoap_eml2_3::eml23__IntegerXmlArray
const * xmlArray =
static_cast<gsoap_eml2_3::eml23__IntegerXmlArray const*
>(arrayInput);
888 const std::regex ws_re(
"\\s+");
889#if !defined(__GLIBCXX__) || __GLIBCXX__ > 20150623 || __GLIBCXX__ == 20140422 || __GLIBCXX__ == 20140716 || __GLIBCXX__ == 20141030
890 std::sregex_token_iterator it(xmlArray->Values.begin(), xmlArray->Values.end(), ws_re, -1);
891 std::sregex_token_iterator endToken;
893 boost::sregex_token_iterator it(xmlArray->Values.begin(), xmlArray->Values.end(), ws_re, -1);
894 boost::sregex_token_iterator endToken;
897 while (it != endToken) {
898 arrayOutput[index++] = std::stoll(*it++);
900 return (std::numeric_limits<T>::max)();
902 default:
throw std::invalid_argument(
"The integer array type is not supported yet.");
915 void readArrayNdOfBooleanValues(gsoap_eml2_3::eml23__BooleanExternalArray
const * arrayInput, int8_t * arrayOutput)
const;
926 uint8_t readArrayNdOfUInt8Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint8_t * arrayOutput)
const;
937 uint8_t readArrayNdOfUInt8Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint8_t * arrayOutput)
const;
948 uint16_t readArrayNdOfUInt16Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint16_t * arrayOutput)
const;
959 uint16_t readArrayNdOfUInt16Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint16_t * arrayOutput)
const;
970 uint32_t readArrayNdOfUInt32Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint32_t * arrayOutput)
const;
981 uint32_t readArrayNdOfUInt32Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint32_t * arrayOutput)
const;
992 uint64_t readArrayNdOfUInt64Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint64_t * arrayOutput)
const;
1003 uint64_t readArrayNdOfUInt64Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint64_t * arrayOutput)
const;
1014 int8_t readArrayNdOfInt8Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int8_t * arrayOutput)
const;
1025 int8_t readArrayNdOfInt8Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int8_t * arrayOutput)
const;
1036 int16_t readArrayNdOfInt16Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int16_t * arrayOutput)
const;
1047 int16_t readArrayNdOfInt16Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int16_t * arrayOutput)
const;
1058 int32_t readArrayNdOfInt32Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int32_t * arrayOutput)
const;
1069 int32_t readArrayNdOfInt32Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int32_t * arrayOutput)
const;
1080 int64_t readArrayNdOfInt64Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int64_t * arrayOutput)
const;
1091 int64_t readArrayNdOfInt64Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int64_t * arrayOutput)
const;
1100 uint64_t getCountOfArray(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput)
const;
1109 uint64_t getCountOfArray(gsoap_eml2_3::eml23__AbstractValueArray
const * arrayInput)
const;
1116 void convertDorIntoRel(
const DataObjectReference& dor);
1127 template <
class valueType>
1128 void convertDorIntoRel(
const DataObjectReference& dor)
1130 valueType * targetObj = getRepository()->getDataObjectByUuid<valueType>(dor.getUuid());
1131 if (targetObj ==
nullptr) {
1132 getRepository()->createPartial(dor);
1133 targetObj = getRepository()->getDataObjectByUuid<valueType>(dor.getUuid());
1134 if (targetObj ==
nullptr) {
1135 throw std::invalid_argument(
"The DOR looks invalid.");
1137 targetObj->setUriSource(getUriSource());
1139 getRepository()->addRelationship(
this, targetObj);
1153 EML2_NS::AbstractHdfProxy* getHdfProxyFromDataset(gsoap_resqml2_0_1::eml20__Hdf5Dataset
const * dataset,
bool throwException =
true)
const;
1165 EML2_NS::AbstractHdfProxy* getOrCreateHdfProxyFromDataArrayPart(gsoap_eml2_3::eml23__ExternalDataArrayPart
const * dataArrayPart)
const;
1170 std::string getHdfGroup()
const {
1171 return "/" + getXmlNamespace() +
"/" + getUuid();
1177 gsoap_eml2_3::eml23__ExternalDataArrayPart* createExternalDataArrayPart(
const std::string& datasetName, LONG64 count, EML2_NS::AbstractHdfProxy* proxy =
nullptr)
const;
1179 gsoap_resqml2_0_1::resqml20__IndexableElements mapIndexableElement(gsoap_eml2_3::eml23__IndexableElement toMap)
const;
1183 static char citationFormat[];
1188 std::string uriSource_;
1197 void setUuid(
const std::string & uuid);