From: emv Date: Thu, 7 Nov 2019 08:19:51 +0000 (+0300) Subject: Mark the duplicating methods to easily identify them for removal after SWIG update. X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=70ebc189b0368bbad2920fa04e2ec2db5124bc33;p=tools%2Fmedcoupling.git Mark the duplicating methods to easily identify them for removal after SWIG update. --- diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.cxx b/src/MEDCoupling/MEDCouplingFieldDouble.cxx index ae95a9636..0636f054a 100755 --- a/src/MEDCoupling/MEDCouplingFieldDouble.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.cxx @@ -2314,8 +2314,9 @@ MEDCouplingFieldDouble *MEDCouplingFieldDouble::keepSelectedComponents(const std } MEDCouplingFieldDouble *MEDCouplingFieldDouble::keepSelectedComponents(const std::vector& compoIds) const { + // The method has to be removed as duplicate after SWIG update std::vector ids (compoIds.size()); - std::copy(compoIds.begin(), compoIds.end(), ids.begin()); + cast_to_remove (compoIds, ids); return keepSelectedComponents(ids); } @@ -2337,6 +2338,7 @@ void MEDCouplingFieldDouble::setSelectedComponents(const MEDCouplingFieldDouble } void MEDCouplingFieldDouble::setSelectedComponents(const MEDCouplingFieldDouble *f, const std::vector& compoIds) { + // The method has to be removed as duplicate after SWIG update timeDiscr()->setSelectedComponents(f->timeDiscr(),compoIds); } diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index dd84f89fb..81a59de1b 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -193,8 +193,9 @@ void DataArray::copyStringInfoFrom(const DataArray& other) void DataArray::copyPartOfStringInfoFrom(const DataArray& other, const std::vector& compoIds) { + // The method has to be removed as duplicate after SWIG update std::vector ids (compoIds.size()); - std::copy(compoIds.begin(), compoIds.end(), ids.begin()); + cast_to_remove(compoIds, ids); copyPartOfStringInfoFrom(other, ids); } @@ -214,8 +215,9 @@ void DataArray::copyPartOfStringInfoFrom(const DataArray& other, const std::vect void DataArray::copyPartOfStringInfoFrom2(const std::vector& compoIds, const DataArray& other) { + // The method has to be removed as duplicate after SWIG update std::vector ids (compoIds.size()); - std::copy(compoIds.begin(), compoIds.end(), ids.begin()); + cast_to_remove (compoIds, ids); copyPartOfStringInfoFrom2(ids, other); } @@ -1361,8 +1363,9 @@ void DataArrayDouble::setSelectedComponents(const DataArrayDouble *a, const std: } void DataArrayDouble::setSelectedComponents(const DataArrayDouble *a, const std::vector& compoIds) { + // The method has to be removed as duplicate after SWIG update std::vector ids (compoIds.size()); - std::copy(compoIds.begin(), compoIds.end(), ids.begin()); + cast_to_remove(compoIds, ids); setSelectedComponents (a, ids); } /*! diff --git a/src/MEDCoupling/MEDCouplingMemArray.txx b/src/MEDCoupling/MEDCouplingMemArray.txx index 5d3ee2f72..9f553fb82 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.txx +++ b/src/MEDCoupling/MEDCouplingMemArray.txx @@ -1355,8 +1355,9 @@ namespace MEDCoupling template typename Traits::ArrayType *DataArrayTemplate::myKeepSelectedComponents(const std::vector& compoIds) const { + // The method has to be removed as duplicate after SWIG update std::vector ids (compoIds.size()); - std::copy(compoIds.begin(), compoIds.end(), ids.begin()); + cast_to_remove(compoIds, ids); return myKeepSelectedComponents (ids); } /*! @@ -4749,8 +4750,9 @@ struct NotInRange template void DataArrayDiscrete::setSelectedComponents(const DataArrayType *a, const std::vector& compoIds) { + // The method has to be removed as duplicate after SWIG update std::vector ids (compoIds.size()); - std::copy(compoIds.begin(), compoIds.end(), ids.begin()); + cast_to_remove(compoIds, ids); setSelectedComponents (a, ids); } diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx index 86c7e27bd..9dd25fa7f 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx @@ -363,8 +363,9 @@ MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::keepSelectedCompon } MEDCouplingTimeDiscretization *MEDCouplingTimeDiscretization::keepSelectedComponents(const std::vector& compoIds) const { + // The method has to be removed as duplicate after SWIG update std::vector ids (compoIds.size()); - std::copy(compoIds.begin(), compoIds.end(), ids.begin()); + cast_to_remove(compoIds, ids); return keepSelectedComponents(ids); } @@ -385,8 +386,9 @@ void MEDCouplingTimeDiscretization::setSelectedComponents(const MEDCouplingTimeD } void MEDCouplingTimeDiscretization::setSelectedComponents(const MEDCouplingTimeDiscretization *other, const std::vector& compoIds) { + // The method has to be removed as duplicate after SWIG update std::vector ids (compoIds.size()); - std::copy(compoIds.begin(), compoIds.end(), ids.begin()); + cast_to_remove (compoIds, ids); setSelectedComponents (other, ids); } diff --git a/src/MEDCoupling/MEDCouplingTraits.hxx b/src/MEDCoupling/MEDCouplingTraits.hxx index 5d550b55e..1976a38cf 100644 --- a/src/MEDCoupling/MEDCouplingTraits.hxx +++ b/src/MEDCoupling/MEDCouplingTraits.hxx @@ -23,9 +23,16 @@ #include "MEDCoupling.hxx" #include "MCType.hxx" +#include namespace MEDCoupling { + inline void cast_to_remove (const std::vector& in, std::vector& out) + { + out.resize (in.size()); + std::copy (in.begin(), in.end(), out.begin()); + } + template struct MEDCOUPLING_EXPORT Traits {