41 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};
68 DLL_IMPORT_OR_EXPORT std::string
getUuid()
const;
79 DLL_IMPORT_OR_EXPORT std::string
getTitle()
const;
213 DLL_IMPORT_OR_EXPORT
void setTitle(
const std::string & title);
225 DLL_IMPORT_OR_EXPORT
void setEditor(
const std::string & editor);
309 DLL_IMPORT_OR_EXPORT
static void setFormat(
const std::string & vendor,
const std::string & applicationName,
const std::string & applicationVersionNumber);
333 DLL_IMPORT_OR_EXPORT
void setVersion(
const std::string & version);
361 DLL_IMPORT_OR_EXPORT
void setMetadata(
const std::string & title,
const std::string & editor, time_t creation,
const std::string & originator,
362 const std::string & description, time_t lastUpdate,
const std::string & descriptiveKeywords);
379 gsoap_resqml2_0_1::eml20__AbstractCitedDataObject*
getEml20GsoapProxy()
const {
return gsoapProxy2_0_1; }
385 void setGsoapProxy(gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* gsoapProxy) { gsoapProxy2_0_1 = gsoapProxy; }
398 void setGsoapProxy(gsoap_eml2_3::eml23__AbstractObject* gsoapProxy) { gsoapProxy2_3 = gsoapProxy; }
449 DLL_IMPORT_OR_EXPORT COMMON_NS::DataObjectRepository*
getRepository()
const {
return repository;}
463 DLL_IMPORT_OR_EXPORT
virtual std::string
getXmlTag()
const = 0;
510 DLL_IMPORT_OR_EXPORT
void addAlias(
const std::string & authority,
const std::string & title);
575 DLL_IMPORT_OR_EXPORT EML2_NS::Activity*
getActivity(uint64_t index)
const;
605 DLL_IMPORT_OR_EXPORT std::vector<std::string>
getExtraMetadata(
const std::string & key)
const;
646 std::string tmp = uriSource_.empty() ?
"eml:///" : uriSource_;
653 DLL_IMPORT_OR_EXPORT
void setUriSource(
const std::string & uriSource) { uriSource_ = uriSource; }
658 DLL_IMPORT_OR_EXPORT
const std::string&
getUriSource()
const {
return uriSource_; }
665 if (uriSource_.find(
".epc") != uriSource_.size() - 4 &&
666 uriSource_.find(
".EPC") != uriSource_.size() - 4) {
670 const size_t slashPos = uriSource_.find_last_of(
"/\\");
671 return slashPos != std::string::npos ? uriSource_.substr(0, slashPos + 1) :
"";
687 gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject;
690 gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* gsoapProxy2_0_1;
693 gsoap_eml2_3::eml23__AbstractObject* gsoapProxy2_3;
696 COMMON_NS::DataObjectRepository* repository;
702 partialObject(nullptr),
703 gsoapProxy2_0_1(nullptr),
704 gsoapProxy2_3(nullptr),
705 repository(nullptr) {}
712 AbstractObject(gsoap_resqml2_0_1::eml20__DataObjectReference* partialObject_) :
713 partialObject(partialObject_),
714 gsoapProxy2_0_1(nullptr),
715 gsoapProxy2_3(nullptr),
716 repository(nullptr) {}
717 AbstractObject(
const DataObjectReference& dor) :
718 partialObject(dor.toDor20()),
719 gsoapProxy2_0_1(nullptr),
720 gsoapProxy2_3(nullptr),
721 repository(nullptr) {}
728 AbstractObject(gsoap_resqml2_0_1::eml20__AbstractCitedDataObject* proxy) :
729 partialObject(nullptr),
730 gsoapProxy2_0_1(proxy),
731 gsoapProxy2_3(nullptr),
732 repository(nullptr) {}
739 AbstractObject(gsoap_eml2_3::eml23__AbstractObject* proxy) :
740 partialObject(nullptr),
741 gsoapProxy2_0_1(nullptr),
742 gsoapProxy2_3(proxy),
743 repository(nullptr) {}
746 AbstractObject(
const AbstractObject&) =
delete;
747 AbstractObject& operator=(
const AbstractObject&) =
delete;
749 friend bool COMMON_NS::DataObjectRepository::addDataObject(std::unique_ptr<COMMON_NS::AbstractObject> proxy);
750 friend COMMON_NS::AbstractObject* COMMON_NS::DataObjectRepository::addOrReplaceDataObject(std::unique_ptr<COMMON_NS::AbstractObject> proxy,
bool replaceOnlyContent);
756 void initMandatoryMetadata();
774 void setMetadata(
const std::string & guid,
const std::string & title,
const std::string & editor, time_t creation,
const std::string & originator,
775 const std::string & description, time_t lastUpdate,
const std::string & descriptiveKeywords);
778 void cannotBePartial()
const;
787 void readArrayNdOfFloatValues(gsoap_resqml2_0_1::resqml20__AbstractDoubleArray
const* arrayInput,
float* arrayOutput)
const;
796 void readArrayNdOfFloatValues(gsoap_eml2_3::eml23__AbstractFloatingPointArray
const* arrayInput,
float* arrayOutput)
const;
805 void readArrayNdOfDoubleValues(gsoap_resqml2_0_1::resqml20__AbstractDoubleArray
const* arrayInput,
double * arrayOutput)
const;
814 void readArrayNdOfDoubleValues(gsoap_eml2_3::eml23__AbstractFloatingPointArray
const* arrayInput,
double * arrayOutput)
const;
817 T readArrayNdOfNonHdf5IntegerValues(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const * arrayInput, T * arrayOutput)
const {
818 switch (arrayInput->soap_type()) {
819 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerRangeArray:
821 gsoap_resqml2_0_1::resqml20__IntegerRangeArray
const* rangeArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerRangeArray
const *
>(arrayInput);
822 if (rangeArray->Value + rangeArray->Count > (std::numeric_limits<T>::max)()) {
823 throw std::range_error(
"The range integer values are superior to maximum value of read datatype.");
825 for (T i = 0; i < static_cast<T>(rangeArray->Count); ++i) {
826 arrayOutput[i] = i +
static_cast<T
>(rangeArray->Value);
828 return (std::numeric_limits<T>::max)();
830 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerConstantArray:
832 gsoap_resqml2_0_1::resqml20__IntegerConstantArray
const* constantArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerConstantArray const*
>(arrayInput);
833 if (
sizeof(constantArray->Value) >
sizeof(T) && constantArray->Value > (std::numeric_limits<T>::max)()) {
834 throw std::range_error(
"The constant integer value is superior to maximum value of read datatype.");
836 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
837 return (std::numeric_limits<T>::max)();
839 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__BooleanConstantArray:
841 gsoap_resqml2_0_1::resqml20__BooleanConstantArray
const* constantArray =
static_cast<gsoap_resqml2_0_1::resqml20__BooleanConstantArray const*
>(arrayInput);
842 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
843 return (std::numeric_limits<T>::max)();
845 case SOAP_TYPE_gsoap_resqml2_0_1_resqml20__IntegerLatticeArray:
847 gsoap_resqml2_0_1::resqml20__IntegerLatticeArray
const* latticeArray =
static_cast<gsoap_resqml2_0_1::resqml20__IntegerLatticeArray const*
>(arrayInput);
848 if (latticeArray->Offset.size() > 1) {
849 throw std::invalid_argument(
"The integer lattice array contains more than one offset.");
851 for (
size_t i = 0; i <= latticeArray->Offset[0]->Count; ++i) {
852 arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
854 return (std::numeric_limits<T>::max)();
857 throw std::invalid_argument(
"The integer array type is not supported yet.");
862 T readArrayNdOfNonHdf5IntegerValues(gsoap_eml2_3::eml23__AbstractValueArray
const * arrayInput, T * arrayOutput)
const {
863 switch (arrayInput->soap_type()) {
864 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerConstantArray:
866 gsoap_eml2_3::eml23__IntegerConstantArray
const* constantArray =
static_cast<gsoap_eml2_3::eml23__IntegerConstantArray const*
>(arrayInput);
867 if (
sizeof(constantArray->Value) >
sizeof(T) && constantArray->Value > (std::numeric_limits<T>::max)()) {
868 throw std::range_error(
"The constant integer value is superior to maximum value of read datatype.");
870 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
871 return (std::numeric_limits<T>::max)();
873 case SOAP_TYPE_gsoap_eml2_3_eml23__BooleanConstantArray:
875 gsoap_eml2_3::eml23__BooleanConstantArray
const* constantArray =
static_cast<gsoap_eml2_3::eml23__BooleanConstantArray const*
>(arrayInput);
876 std::fill(arrayOutput, arrayOutput + constantArray->Count,
static_cast<T
>(constantArray->Value));
877 return (std::numeric_limits<T>::max)();
879 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerLatticeArray:
881 gsoap_eml2_3::eml23__IntegerLatticeArray
const* latticeArray =
static_cast<gsoap_eml2_3::eml23__IntegerLatticeArray const*
>(arrayInput);
882 if (latticeArray->Offset.empty() || latticeArray->Offset.size() > 1) {
883 throw std::invalid_argument(
"The integer lattice array of UUID " + getUuid() +
" contains zero or more than one offset.");
885 if (latticeArray->Offset[0]->Count < 0) {
886 throw std::invalid_argument(
"The count of the integer lattice array of UUID " + getUuid() +
" is negative which is not valid.");
889 for (
size_t i = 0; i <= static_cast<size_t>(latticeArray->Offset[0]->Count); ++i) {
890 arrayOutput[i] = latticeArray->StartValue + (i * latticeArray->Offset[0]->Value);
892 return (std::numeric_limits<T>::max)();
894 case SOAP_TYPE_gsoap_eml2_3_eml23__IntegerXmlArray:
896 gsoap_eml2_3::eml23__IntegerXmlArray
const * xmlArray =
static_cast<gsoap_eml2_3::eml23__IntegerXmlArray const*
>(arrayInput);
897 const std::regex ws_re(
"\\s+");
898 std::sregex_token_iterator it(xmlArray->Values.begin(), xmlArray->Values.end(), ws_re, -1);
899 std::sregex_token_iterator endToken;
901 while (it != endToken) {
902 arrayOutput[index++] = std::stoll(*it++);
904 return (std::numeric_limits<T>::max)();
906 default:
throw std::invalid_argument(
"The integer array type is not supported yet.");
919 void readArrayNdOfBooleanValues(gsoap_eml2_3::eml23__BooleanExternalArray
const * arrayInput, int8_t * arrayOutput)
const;
930 uint8_t readArrayNdOfUInt8Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint8_t * arrayOutput)
const;
941 uint8_t readArrayNdOfUInt8Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint8_t * arrayOutput)
const;
952 uint16_t readArrayNdOfUInt16Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint16_t * arrayOutput)
const;
963 uint16_t readArrayNdOfUInt16Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint16_t * arrayOutput)
const;
974 uint32_t readArrayNdOfUInt32Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint32_t * arrayOutput)
const;
985 uint32_t readArrayNdOfUInt32Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint32_t * arrayOutput)
const;
996 uint64_t readArrayNdOfUInt64Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, uint64_t * arrayOutput)
const;
1007 uint64_t readArrayNdOfUInt64Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, uint64_t * arrayOutput)
const;
1018 int8_t readArrayNdOfInt8Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int8_t * arrayOutput)
const;
1029 int8_t readArrayNdOfInt8Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int8_t * arrayOutput)
const;
1040 int16_t readArrayNdOfInt16Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int16_t * arrayOutput)
const;
1051 int16_t readArrayNdOfInt16Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int16_t * arrayOutput)
const;
1062 int32_t readArrayNdOfInt32Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int32_t * arrayOutput)
const;
1073 int32_t readArrayNdOfInt32Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int32_t * arrayOutput)
const;
1084 int64_t readArrayNdOfInt64Values(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput, int64_t * arrayOutput)
const;
1095 int64_t readArrayNdOfInt64Values(gsoap_eml2_3::eml23__AbstractValueArray
const* arrayInput, int64_t * arrayOutput)
const;
1104 uint64_t getCountOfArray(gsoap_resqml2_0_1::resqml20__AbstractValueArray
const* arrayInput)
const;
1113 uint64_t getCountOfArray(gsoap_eml2_3::eml23__AbstractValueArray
const * arrayInput)
const;
1120 void convertDorIntoRel(
const DataObjectReference& dor);
1131 template <
class valueType>
1132 void convertDorIntoRel(
const DataObjectReference& dor)
1134 valueType * targetObj = getRepository()->getDataObjectByUuid<valueType>(dor.getUuid());
1135 if (targetObj ==
nullptr) {
1136 getRepository()->createPartial(dor);
1137 targetObj = getRepository()->getDataObjectByUuid<valueType>(dor.getUuid());
1138 if (targetObj ==
nullptr) {
1139 throw std::invalid_argument(
"The DOR looks invalid.");
1141 targetObj->setUriSource(getUriSource());
1143 getRepository()->addRelationship(
this, targetObj);
1157 EML2_NS::AbstractHdfProxy* getHdfProxyFromDataset(gsoap_resqml2_0_1::eml20__Hdf5Dataset
const * dataset,
bool throwException =
true)
const;
1169 EML2_NS::AbstractHdfProxy* getOrCreateHdfProxyFromDataArrayPart(gsoap_eml2_3::eml23__ExternalDataArrayPart
const * dataArrayPart)
const;
1174 std::string getHdfGroup()
const {
1175 return "/" + getXmlNamespace() +
"/" + getUuid();
1181 gsoap_eml2_3::eml23__ExternalDataArrayPart* createExternalDataArrayPart(
const std::string& datasetName, LONG64 count, EML2_NS::AbstractHdfProxy* proxy =
nullptr)
const;
1183 gsoap_resqml2_0_1::resqml20__IndexableElements mapIndexableElement(gsoap_eml2_3::eml23__IndexableElement toMap)
const;
1187 static char citationFormat[];
1192 std::string uriSource_;
1201 void setUuid(
const std::string & uuid);