diff --git a/Modules/Core/Metadata/include/otbXMLMetadataSupplier.h b/Modules/Core/Metadata/include/otbXMLMetadataSupplier.h index 9481708b503f3f5119258252c6487009991dac42..b7969b3300d5ba2a02c9c83d253ab295495a27ab 100644 --- a/Modules/Core/Metadata/include/otbXMLMetadataSupplier.h +++ b/Modules/Core/Metadata/include/otbXMLMetadataSupplier.h @@ -43,6 +43,8 @@ class OTBMetadata_EXPORT XMLMetadataSupplier { public: XMLMetadataSupplier(const std::string &); + XMLMetadataSupplier(const XMLMetadataSupplier &) = delete; + XMLMetadataSupplier& operator=(const XMLMetadataSupplier&) = delete; /** * @brief Get the metadata value corresponding to a given path diff --git a/Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx b/Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx index 959aa22fad4ede820c48cf1c7beb4f2b382e9f56..0d8d81ffea83f031b82ae309d96abbc6b2b5d492 100644 --- a/Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx +++ b/Modules/Core/Metadata/src/otbSentinel1ImageMetadataInterface.cxx @@ -549,7 +549,7 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds std::string ManifestFilePath = mds->GetResourceFile(std::string("manifest\\.safe")); if (!ManifestFilePath.empty()) { - XMLMetadataSupplier ManifestMS = XMLMetadataSupplier(ManifestFilePath); + XMLMetadataSupplier ManifestMS(ManifestFilePath); m_Imd.Add(MDTime::ProductionDate, ManifestMS.GetFirstAs<MetaData::Time>("xfdu:XFDU.metadataSection.metadataObject_#.metadataWrap.xmlData.safe:processing.start")); m_Imd.Add(MDTime::AcquisitionDate, @@ -569,7 +569,7 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds + std::string("-.*\\.xml")); if (AnnotationFilePath.empty()) otbGenericExceptionMacro(MissingMetadataException,<<"Missing Annotation file for band '"<<swath<<"'"); - XMLMetadataSupplier AnnotationMS = XMLMetadataSupplier(AnnotationFilePath); + XMLMetadataSupplier AnnotationMS(AnnotationFilePath); sarParam.azimuthFmRate = this->GetAzimuthFmRate(AnnotationMS); sarParam.dopplerCentroid = this->GetDopplerCentroid(AnnotationMS); @@ -587,7 +587,7 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds + itksys::SystemTools::GetFilenameName(AnnotationFilePath); if (CalibrationFilePath.empty()) otbGenericExceptionMacro(MissingMetadataException,<<"Missing Calibration file for band '"<<swath<<"'"); - XMLMetadataSupplier CalibrationMS = XMLMetadataSupplier(CalibrationFilePath); + XMLMetadataSupplier CalibrationMS(CalibrationFilePath); m_Imd.Add(MDNum::CalScale, CalibrationMS.GetAs<double>("calibration.calibrationInformation.absoluteCalibrationConstant")); sarParam.calibrationVectors = this->GetCalibrationVector(CalibrationMS); std::istringstream(CalibrationMS.GetAs<std::string>("calibration.adsHeader.startTime")) >> sarParam.calibrationStartTime; @@ -599,7 +599,7 @@ void Sentinel1ImageMetadataInterface::Parse(const MetadataSupplierInterface *mds + itksys::SystemTools::GetFilenameName(AnnotationFilePath); if (NoiseFilePath.empty()) otbGenericExceptionMacro(MissingMetadataException,<<"Missing Noise file for band '"<<swath<<"'"); - XMLMetadataSupplier NoiseMS = XMLMetadataSupplier(NoiseFilePath); + XMLMetadataSupplier NoiseMS(NoiseFilePath); m_Imd.Bands[bandId].Add(MDGeom::SAR, sarParam); }