From 89ffd6be1633e2ab70ac3298a8a10a635a3f4df3 Mon Sep 17 00:00:00 2001 From: ageay Date: Thu, 22 Aug 2013 08:29:36 +0000 Subject: [PATCH] getHeapMemorySize rearch --- src/MEDCalculator/MEDCalculatorDBField.cxx | 4 +- src/MEDCalculator/MEDCalculatorDBField.hxx | 2 +- .../MEDCalculatorDBSliceField.cxx | 4 +- .../MEDCalculatorDBSliceField.hxx | 2 +- src/MEDCoupling/MEDCoupling1GTUMesh.cxx | 14 ++-- src/MEDCoupling/MEDCoupling1GTUMesh.hxx | 4 +- src/MEDCoupling/MEDCouplingCMesh.cxx | 10 +-- src/MEDCoupling/MEDCouplingCMesh.hxx | 2 +- .../MEDCouplingCurveLinearMesh.cxx | 6 +- .../MEDCouplingCurveLinearMesh.hxx | 2 +- src/MEDCoupling/MEDCouplingDefinitionTime.cxx | 8 +- src/MEDCoupling/MEDCouplingDefinitionTime.hxx | 4 +- src/MEDCoupling/MEDCouplingExtrudedMesh.cxx | 10 +-- src/MEDCoupling/MEDCouplingExtrudedMesh.hxx | 2 +- src/MEDCoupling/MEDCouplingField.cxx | 8 +- src/MEDCoupling/MEDCouplingField.hxx | 2 +- .../MEDCouplingFieldDiscretization.cxx | 10 +-- .../MEDCouplingFieldDiscretization.hxx | 4 +- src/MEDCoupling/MEDCouplingFieldDouble.cxx | 6 +- src/MEDCoupling/MEDCouplingFieldDouble.hxx | 2 +- src/MEDCoupling/MEDCouplingMemArray.cxx | 4 +- src/MEDCoupling/MEDCouplingMemArray.hxx | 2 +- src/MEDCoupling/MEDCouplingMultiFields.cxx | 6 +- src/MEDCoupling/MEDCouplingMultiFields.hxx | 2 +- src/MEDCoupling/MEDCouplingPointSet.cxx | 6 +- src/MEDCoupling/MEDCouplingPointSet.hxx | 2 +- src/MEDCoupling/MEDCouplingRefCountObject.cxx | 76 ++++++++++++------- src/MEDCoupling/MEDCouplingRefCountObject.hxx | 32 +++++--- .../MEDCouplingTimeDiscretization.cxx | 12 +-- .../MEDCouplingTimeDiscretization.hxx | 6 +- src/MEDCoupling/MEDCouplingUMesh.cxx | 8 +- src/MEDCoupling/MEDCouplingUMesh.hxx | 2 +- src/MEDCoupling_Swig/MEDCouplingCommon.i | 37 +++++++-- src/MEDLoader/MEDFileData.cxx | 10 +-- src/MEDLoader/MEDFileData.hxx | 2 +- src/MEDLoader/MEDFileField.cxx | 66 ++++++++-------- src/MEDLoader/MEDFileField.hxx | 22 +++--- src/MEDLoader/MEDFileFieldOverView.cxx | 34 ++++----- src/MEDLoader/MEDFileFieldOverView.hxx | 16 ++-- src/MEDLoader/MEDFileMesh.cxx | 60 +++++++-------- src/MEDLoader/MEDFileMesh.hxx | 14 ++-- src/MEDLoader/MEDFileMeshElt.cxx | 12 +-- src/MEDLoader/MEDFileMeshElt.hxx | 2 +- src/MEDLoader/MEDFileMeshLL.cxx | 26 +++---- src/MEDLoader/MEDFileMeshLL.hxx | 8 +- src/MEDLoader/MEDFileParameter.cxx | 20 ++--- src/MEDLoader/MEDFileParameter.hxx | 8 +- src/MEDLoader/SauvReader.cxx | 4 +- src/MEDLoader/SauvReader.hxx | 2 +- src/MEDLoader/SauvUtilities.hxx | 2 +- src/MEDLoader/SauvWriter.cxx | 4 +- src/MEDLoader/SauvWriter.hxx | 2 +- 52 files changed, 337 insertions(+), 278 deletions(-) diff --git a/src/MEDCalculator/MEDCalculatorDBField.cxx b/src/MEDCalculator/MEDCalculatorDBField.cxx index 78110d2cc..d9d3a8ed3 100644 --- a/src/MEDCalculator/MEDCalculatorDBField.cxx +++ b/src/MEDCalculator/MEDCalculatorDBField.cxx @@ -51,9 +51,9 @@ std::size_t MEDCalculatorDBField::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector MEDCalculatorDBField::getDirectChildren() const +std::vector MEDCalculatorDBField::getDirectChildren() const { - return std::vector(); + return std::vector(); } MEDCalculatorDBField *MEDCalculatorDBField::operator+(double val) const throw(INTERP_KERNEL::Exception) diff --git a/src/MEDCalculator/MEDCalculatorDBField.hxx b/src/MEDCalculator/MEDCalculatorDBField.hxx index 6809b9659..1d07aed71 100644 --- a/src/MEDCalculator/MEDCalculatorDBField.hxx +++ b/src/MEDCalculator/MEDCalculatorDBField.hxx @@ -46,7 +46,7 @@ namespace ParaMEDMEM static MEDCalculatorDBFieldReal *New(const MEDCalculatorBrowserField& ls); static MEDCalculatorDBFieldCst *New(double val); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; virtual MEDCalculatorDBField *operator+(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception) = 0; MEDCalculatorDBField *operator+(double val) const throw(INTERP_KERNEL::Exception); virtual MEDCalculatorDBField *operator-(const MEDCalculatorDBField& other) const throw(INTERP_KERNEL::Exception) = 0; diff --git a/src/MEDCalculator/MEDCalculatorDBSliceField.cxx b/src/MEDCalculator/MEDCalculatorDBSliceField.cxx index b559c079b..4916d01f2 100644 --- a/src/MEDCalculator/MEDCalculatorDBSliceField.cxx +++ b/src/MEDCalculator/MEDCalculatorDBSliceField.cxx @@ -41,9 +41,9 @@ std::size_t MEDCalculatorDBSliceField::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector MEDCalculatorDBSliceField::getDirectChildren() const +std::vector MEDCalculatorDBSliceField::getDirectChildren() const { - return std::vector(); + return std::vector(); } void MEDCalculatorDBSliceField::setField(MEDCouplingFieldDouble *f) const diff --git a/src/MEDCalculator/MEDCalculatorDBSliceField.hxx b/src/MEDCalculator/MEDCalculatorDBSliceField.hxx index 35de50da9..464b1b83b 100644 --- a/src/MEDCalculator/MEDCalculatorDBSliceField.hxx +++ b/src/MEDCalculator/MEDCalculatorDBSliceField.hxx @@ -41,7 +41,7 @@ namespace ParaMEDMEM MEDCalculatorDBSliceField(int iter, int order); MEDCalculatorDBSliceField(MEDCouplingFieldDouble *f); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; bool isFetched() const { return _field!=0; } void getDtIt(int& it, int& order) const { it=_iteration; order=_order; } void setField(MEDCouplingFieldDouble *f) const; diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx index 880552182..329d1b386 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.cxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.cxx @@ -572,12 +572,12 @@ std::size_t MEDCoupling1SGTUMesh::getHeapMemorySizeWithoutChildren() const return MEDCoupling1GTUMesh::getHeapMemorySizeWithoutChildren(); } -std::vector MEDCoupling1SGTUMesh::getDirectChildren() const +std::vector MEDCoupling1SGTUMesh::getDirectChildren() const { - std::vector ret(MEDCoupling1GTUMesh::getDirectChildren()); + std::vector ret(MEDCoupling1GTUMesh::getDirectChildren()); const DataArrayInt *c(_conn); if(c) - ret.push_back(const_cast(c)); + ret.push_back(c); return ret; } @@ -1909,15 +1909,15 @@ std::size_t MEDCoupling1DGTUMesh::getHeapMemorySizeWithoutChildren() const return MEDCoupling1GTUMesh::getHeapMemorySizeWithoutChildren(); } -std::vector MEDCoupling1DGTUMesh::getDirectChildren() const +std::vector MEDCoupling1DGTUMesh::getDirectChildren() const { - std::vector ret(MEDCoupling1GTUMesh::getDirectChildren()); + std::vector ret(MEDCoupling1GTUMesh::getDirectChildren()); const DataArrayInt *c(_conn); if(c) - ret.push_back(const_cast(c)); + ret.push_back(c); c=_conn_indx; if(c) - ret.push_back(const_cast(c)); + ret.push_back(c); return ret; } diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx index bb51d043e..a6e01a72d 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx @@ -94,7 +94,7 @@ namespace ParaMEDMEM // overload of TimeLabel and RefCountObject MEDCOUPLING_EXPORT void updateTime() const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDCOUPLING_EXPORT std::vector getDirectChildren() const; + MEDCOUPLING_EXPORT std::vector getDirectChildren() const; // overload of MEDCouplingMesh MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return SINGLE_STATIC_GEO_TYPE_UNSTRUCTURED; } MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const; @@ -179,7 +179,7 @@ namespace ParaMEDMEM // overload of TimeLabel and RefCountObject MEDCOUPLING_EXPORT void updateTime() const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDCOUPLING_EXPORT std::vector getDirectChildren() const; + MEDCOUPLING_EXPORT std::vector getDirectChildren() const; // overload of MEDCouplingMesh MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return SINGLE_DYNAMIC_GEO_TYPE_UNSTRUCTURED; } MEDCOUPLING_EXPORT MEDCouplingMesh *deepCpy() const; diff --git a/src/MEDCoupling/MEDCouplingCMesh.cxx b/src/MEDCoupling/MEDCouplingCMesh.cxx index 70d3c7a6a..fa0e74eb5 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCMesh.cxx @@ -111,15 +111,15 @@ std::size_t MEDCouplingCMesh::getHeapMemorySizeWithoutChildren() const return MEDCouplingStructuredMesh::getHeapMemorySizeWithoutChildren(); } -std::vector MEDCouplingCMesh::getDirectChildren() const +std::vector MEDCouplingCMesh::getDirectChildren() const { - std::vector ret; + std::vector ret; if(_x_array) - ret.push_back(const_cast(_x_array)); + ret.push_back(_x_array); if(_y_array) - ret.push_back(const_cast(_y_array)); + ret.push_back(_y_array); if(_z_array) - ret.push_back(const_cast(_z_array)); + ret.push_back(_z_array); return ret; } diff --git a/src/MEDCoupling/MEDCouplingCMesh.hxx b/src/MEDCoupling/MEDCouplingCMesh.hxx index 6d1cba871..fbaa5b021 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCMesh.hxx @@ -38,7 +38,7 @@ namespace ParaMEDMEM MEDCouplingCMesh *clone(bool recDeepCpy) const; void updateTime() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDCouplingMeshType getType() const { return CARTESIAN; } void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception); bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx index 31ecee094..0bd1deb49 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.cxx @@ -87,11 +87,11 @@ std::size_t MEDCouplingCurveLinearMesh::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDCouplingCurveLinearMesh::getDirectChildren() const +std::vector MEDCouplingCurveLinearMesh::getDirectChildren() const { - std::vector ret; + std::vector ret; if((const DataArrayDouble *)_coords) - ret.push_back(const_cast((const DataArrayDouble *)_coords)); + ret.push_back((const DataArrayDouble *)_coords); return ret; } diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx index 13df6d043..94f7a6424 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx @@ -39,7 +39,7 @@ namespace ParaMEDMEM MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const; void updateTime() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDCouplingMeshType getType() const { return CURVE_LINEAR; } void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception); bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling/MEDCouplingDefinitionTime.cxx b/src/MEDCoupling/MEDCouplingDefinitionTime.cxx index 19e452461..e3adbed2c 100644 --- a/src/MEDCoupling/MEDCouplingDefinitionTime.cxx +++ b/src/MEDCoupling/MEDCouplingDefinitionTime.cxx @@ -114,9 +114,9 @@ std::size_t MEDCouplingDefinitionTimeSlice::getHeapMemorySizeWithoutChildren() c return 0; } -std::vector MEDCouplingDefinitionTimeSlice::getDirectChildren() const +std::vector MEDCouplingDefinitionTimeSlice::getDirectChildren() const { - return std::vector(); + return std::vector(); } bool MEDCouplingDefinitionTimeSlice::isFullyIncludedInMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const @@ -474,9 +474,9 @@ std::size_t MEDCouplingDefinitionTime::getHeapMemorySizeWithoutChildren() const return _slices.capacity()*(sizeof(MEDCouplingDefinitionTimeSlice)+sizeof(int)); } -std::vector MEDCouplingDefinitionTime::getDirectChildren() const +std::vector MEDCouplingDefinitionTime::getDirectChildren() const { - return std::vector(); + return std::vector(); } void MEDCouplingDefinitionTime::assign(const MEDCouplingDefinitionTime& other) diff --git a/src/MEDCoupling/MEDCouplingDefinitionTime.hxx b/src/MEDCoupling/MEDCouplingDefinitionTime.hxx index deb519243..cc3c6c88b 100644 --- a/src/MEDCoupling/MEDCouplingDefinitionTime.hxx +++ b/src/MEDCoupling/MEDCouplingDefinitionTime.hxx @@ -52,7 +52,7 @@ namespace ParaMEDMEM virtual void getTinySerializationInformation(std::vector& tiI, std::vector& tiD) const = 0; virtual TypeOfTimeDiscretization getTimeType() const = 0; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; bool isFullyIncludedInMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const; bool isOverllapingWithMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const; bool isAfterMe(const MEDCouplingDefinitionTimeSlice *other, double eps) const; @@ -145,7 +145,7 @@ namespace ParaMEDMEM MEDCouplingDefinitionTime(); MEDCouplingDefinitionTime(const std::vector& fs, const std::vector& meshRefs, const std::vector >& arrRefs) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; void assign(const MEDCouplingDefinitionTime& other); bool isEqual(const MEDCouplingDefinitionTime& other) const; double getTimeResolution() const { return _eps; } diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx index 14a29179d..c5a585b88 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.cxx @@ -69,15 +69,15 @@ std::size_t MEDCouplingExtrudedMesh::getHeapMemorySizeWithoutChildren() const return MEDCouplingMesh::getHeapMemorySizeWithoutChildren(); } -std::vector MEDCouplingExtrudedMesh::getDirectChildren() const +std::vector MEDCouplingExtrudedMesh::getDirectChildren() const { - std::vector ret; + std::vector ret; if(_mesh2D) - ret.push_back(const_cast(_mesh2D)); + ret.push_back(_mesh2D); if(_mesh1D) - ret.push_back(const_cast(_mesh1D)); + ret.push_back(_mesh1D); if(_mesh3D_ids) - ret.push_back(const_cast(_mesh3D_ids)); + ret.push_back(_mesh3D_ids); return ret; } diff --git a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx index 8aa72199d..40f78aab5 100644 --- a/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx +++ b/src/MEDCoupling/MEDCouplingExtrudedMesh.hxx @@ -40,7 +40,7 @@ namespace ParaMEDMEM static MEDCouplingExtrudedMesh *New(); MEDCouplingMeshType getType() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; void copyTinyStringsFrom(const MEDCouplingMesh *other) throw(INTERP_KERNEL::Exception); int getNumberOfCells() const; int getNumberOfNodes() const; diff --git a/src/MEDCoupling/MEDCouplingField.cxx b/src/MEDCoupling/MEDCouplingField.cxx index c7813180a..f96321bb1 100644 --- a/src/MEDCoupling/MEDCouplingField.cxx +++ b/src/MEDCoupling/MEDCouplingField.cxx @@ -161,13 +161,13 @@ std::size_t MEDCouplingField::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDCouplingField::getDirectChildren() const +std::vector MEDCouplingField::getDirectChildren() const { - std::vector ret; + std::vector ret; if(_mesh) - ret.push_back(const_cast(_mesh)); + ret.push_back(_mesh); if((const MEDCouplingFieldDiscretization *)_type) - ret.push_back(const_cast((const MEDCouplingFieldDiscretization *)_type)); + ret.push_back((const MEDCouplingFieldDiscretization *)_type); return ret; } diff --git a/src/MEDCoupling/MEDCouplingField.hxx b/src/MEDCoupling/MEDCouplingField.hxx index 5cf5bbf08..fd18e0c82 100644 --- a/src/MEDCoupling/MEDCouplingField.hxx +++ b/src/MEDCoupling/MEDCouplingField.hxx @@ -85,7 +85,7 @@ namespace ParaMEDMEM const MEDCouplingGaussLocalization& getGaussLocalization(int locId) const throw(INTERP_KERNEL::Exception); void updateTime() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; // for MED file RW int getNumberOfTuplesExpectedRegardingCode(const std::vector& code, const std::vector& idsPerType) const throw(INTERP_KERNEL::Exception); virtual void reprQuickOverview(std::ostream& stream) const throw(INTERP_KERNEL::Exception) = 0; diff --git a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx index 9e493da41..aa17d7bb1 100644 --- a/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDiscretization.cxx @@ -184,9 +184,9 @@ std::size_t MEDCouplingFieldDiscretization::getHeapMemorySizeWithoutChildren() c return 0; } -std::vector MEDCouplingFieldDiscretization::getDirectChildren() const +std::vector MEDCouplingFieldDiscretization::getDirectChildren() const { - return std::vector(); + return std::vector(); } /*! @@ -1080,11 +1080,11 @@ std::size_t MEDCouplingFieldDiscretizationPerCell::getHeapMemorySizeWithoutChild return ret; } -std::vector MEDCouplingFieldDiscretizationPerCell::getDirectChildren() const +std::vector MEDCouplingFieldDiscretizationPerCell::getDirectChildren() const { - std::vector ret(MEDCouplingFieldDiscretization::getDirectChildren()); + std::vector ret(MEDCouplingFieldDiscretization::getDirectChildren()); if(_discr_per_cell) - ret.push_back(const_cast(_discr_per_cell)); + ret.push_back(_discr_per_cell); return ret; } diff --git a/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx b/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx index a56d3b25c..effe0bbc7 100644 --- a/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx +++ b/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx @@ -48,7 +48,7 @@ namespace ParaMEDMEM void setPrecision(double val) { _precision=val; } void updateTime() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; static TypeOfField GetTypeOfFieldFromStringRepr(const char *repr) throw(INTERP_KERNEL::Exception); virtual TypeOfField getEnum() const = 0; virtual bool isEqual(const MEDCouplingFieldDiscretization *other, double eps) const; @@ -210,7 +210,7 @@ namespace ParaMEDMEM ~MEDCouplingFieldDiscretizationPerCell(); void updateTime() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; void checkCoherencyBetween(const MEDCouplingMesh *mesh, const DataArray *da) const throw(INTERP_KERNEL::Exception); bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const; bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const; diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.cxx b/src/MEDCoupling/MEDCouplingFieldDouble.cxx index 954408c64..c2208f82b 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.cxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.cxx @@ -1785,12 +1785,12 @@ std::size_t MEDCouplingFieldDouble::getHeapMemorySizeWithoutChildren() const return MEDCouplingField::getHeapMemorySizeWithoutChildren(); } -std::vector MEDCouplingFieldDouble::getDirectChildren() const +std::vector MEDCouplingFieldDouble::getDirectChildren() const { - std::vector ret(MEDCouplingField::getDirectChildren()); + std::vector ret(MEDCouplingField::getDirectChildren()); if(_time_discr) { - std::vector ret2(_time_discr->getDirectChildren()); + std::vector ret2(_time_discr->getDirectChildren()); ret.insert(ret.end(),ret2.begin(),ret2.end()); } return ret; diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.hxx b/src/MEDCoupling/MEDCouplingFieldDouble.hxx index a99041fed..0bd5419f8 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.hxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.hxx @@ -131,7 +131,7 @@ namespace ParaMEDMEM int getNumberOfValues() const throw(INTERP_KERNEL::Exception); void updateTime() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; // void getTinySerializationIntInformation(std::vector& tinyInfo) const; void getTinySerializationDbleInformation(std::vector& tinyInfo) const; diff --git a/src/MEDCoupling/MEDCouplingMemArray.cxx b/src/MEDCoupling/MEDCouplingMemArray.cxx index 3dc5f450d..67edb173c 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.cxx +++ b/src/MEDCoupling/MEDCouplingMemArray.cxx @@ -120,9 +120,9 @@ std::size_t DataArray::getHeapMemorySizeWithoutChildren() const return sz1+sz2+sz3; } -std::vector DataArray::getDirectChildren() const +std::vector DataArray::getDirectChildren() const { - return std::vector(); + return std::vector(); } /*! diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index 6000da785..a28f2dfdf 100644 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -116,7 +116,7 @@ namespace ParaMEDMEM { public: MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDCOUPLING_EXPORT std::vector getDirectChildren() const; + MEDCOUPLING_EXPORT std::vector getDirectChildren() const; MEDCOUPLING_EXPORT void setName(const char *name); MEDCOUPLING_EXPORT void copyStringInfoFrom(const DataArray& other) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void copyPartOfStringInfoFrom(const DataArray& other, const std::vector& compoIds) throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling/MEDCouplingMultiFields.cxx b/src/MEDCoupling/MEDCouplingMultiFields.cxx index 436ab8d20..97653a8b2 100644 --- a/src/MEDCoupling/MEDCouplingMultiFields.cxx +++ b/src/MEDCoupling/MEDCouplingMultiFields.cxx @@ -195,14 +195,14 @@ std::size_t MEDCouplingMultiFields::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector MEDCouplingMultiFields::getDirectChildren() const +std::vector MEDCouplingMultiFields::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_fs.begin();it!=_fs.end();it++) { const MEDCouplingFieldDouble *curF(*it); if(curF) - ret.push_back(const_cast(curF)); + ret.push_back(curF); } return ret; } diff --git a/src/MEDCoupling/MEDCouplingMultiFields.hxx b/src/MEDCoupling/MEDCouplingMultiFields.hxx index d770576e2..d31b816ab 100644 --- a/src/MEDCoupling/MEDCouplingMultiFields.hxx +++ b/src/MEDCoupling/MEDCouplingMultiFields.hxx @@ -60,7 +60,7 @@ namespace ParaMEDMEM virtual std::vector getDifferentArrays(std::vector< std::vector >& refs) const throw(INTERP_KERNEL::Exception); void updateTime() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; void getTinySerializationInformation(std::vector& tinyInfo, std::vector& tinyInfo2, int& nbOfDiffMeshes, int& nbOfDiffArr) const; void finishUnserialization(const std::vector& tinyInfoI, const std::vector& tinyInfoD, const std::vector& ft, const std::vector& ms, diff --git a/src/MEDCoupling/MEDCouplingPointSet.cxx b/src/MEDCoupling/MEDCouplingPointSet.cxx index 8c3fb4660..6d90de508 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.cxx +++ b/src/MEDCoupling/MEDCouplingPointSet.cxx @@ -80,11 +80,11 @@ std::size_t MEDCouplingPointSet::getHeapMemorySizeWithoutChildren() const return MEDCouplingMesh::getHeapMemorySizeWithoutChildren(); } -std::vector MEDCouplingPointSet::getDirectChildren() const +std::vector MEDCouplingPointSet::getDirectChildren() const { - std::vector ret; + std::vector ret; if(_coords) - ret.push_back(const_cast(_coords)); + ret.push_back(_coords); return ret; } diff --git a/src/MEDCoupling/MEDCouplingPointSet.hxx b/src/MEDCoupling/MEDCouplingPointSet.hxx index df12ac7b2..c591ac655 100644 --- a/src/MEDCoupling/MEDCouplingPointSet.hxx +++ b/src/MEDCoupling/MEDCouplingPointSet.hxx @@ -53,7 +53,7 @@ namespace ParaMEDMEM public: void updateTime() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; int getNumberOfNodes() const; int getSpaceDimension() const; void setCoords(const DataArrayDouble *coords); diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.cxx b/src/MEDCoupling/MEDCouplingRefCountObject.cxx index 49d954f8e..39794d403 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.cxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.cxx @@ -71,39 +71,24 @@ const char *ParaMEDMEM::MEDCouplingByteOrderStr() return BIGENDIAN_STR; } -RefCountObject::RefCountObject():_cnt(1) -{ -} +//= -RefCountObject::RefCountObject(const RefCountObject& other):_cnt(1) -{ -} - -/*! - * Do nothing here ! It is not a bug ( I hope :) ) because all subclasses that - * copies using operator= should not copy the ref counter of \a other ! - */ -RefCountObject& RefCountObject::operator=(const RefCountObject& other) -{ - return *this; -} - -std::size_t RefCountObject::getHeapMemorySize() const +std::size_t BigMemoryObject::getHeapMemorySize() const { std::size_t ret(getHeapMemorySizeWithoutChildren()); - std::vector v(getDirectChildren()); - std::set s1,s2(v.begin(),v.end()); + std::vector v(getDirectChildren()); + std::set s1,s2(v.begin(),v.end()); while(!s2.empty()) { - std::set s3; - for(std::set::const_iterator it=s2.begin();it!=s2.end();it++) + std::set s3; + for(std::set::const_iterator it=s2.begin();it!=s2.end();it++) { if(s1.find(*it)==s1.end()) { ret+=(*it)->getHeapMemorySizeWithoutChildren(); s1.insert(*it); - std::vector v2((*it)->getDirectChildren()); - for(std::vector::const_iterator it2=v2.begin();it2!=v2.end();it2++) + std::vector v2((*it)->getDirectChildren()); + for(std::vector::const_iterator it2=v2.begin();it2!=v2.end();it2++) if(s1.find(*it2)==s1.end()) s3.insert(*it2); } @@ -113,7 +98,7 @@ std::size_t RefCountObject::getHeapMemorySize() const return ret; } -std::string RefCountObject::getHeapMemorySizeStr() const +std::string BigMemoryObject::getHeapMemorySizeStr() const { static const char *UNITS[4]={"B","kB","MB","GB"}; std::size_t m(getHeapMemorySize()); @@ -153,7 +138,21 @@ std::string RefCountObject::getHeapMemorySizeStr() const return oss.str(); } -bool RefCountObject::decrRef() const +BigMemoryObject::~BigMemoryObject() +{ +} + +//= + +RefCountObjectOnly::RefCountObjectOnly():_cnt(1) +{ +} + +RefCountObjectOnly::RefCountObjectOnly(const RefCountObjectOnly& other):_cnt(1) +{ +} + +bool RefCountObjectOnly::decrRef() const { bool ret=((--_cnt)==0); if(ret) @@ -161,16 +160,39 @@ bool RefCountObject::decrRef() const return ret; } -void RefCountObject::incrRef() const +void RefCountObjectOnly::incrRef() const { _cnt++; } -int RefCountObject::getRCValue() const +int RefCountObjectOnly::getRCValue() const { return _cnt; } +RefCountObjectOnly::~RefCountObjectOnly() +{ +} + +/*! + * Do nothing here ! It is not a bug ( I hope :) ) because all subclasses that + * copies using operator= should not copy the ref counter of \a other ! + */ +RefCountObjectOnly& RefCountObjectOnly::operator=(const RefCountObjectOnly& other) +{ + return *this; +} + +//= + +RefCountObject::RefCountObject() +{ +} + +RefCountObject::RefCountObject(const RefCountObject& other):RefCountObjectOnly(other) +{ +} + RefCountObject::~RefCountObject() { } diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.hxx b/src/MEDCoupling/MEDCouplingRefCountObject.hxx index 3d987d706..ce51360d2 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.hxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.hxx @@ -61,25 +61,39 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT bool MEDCouplingByteOrder(); MEDCOUPLING_EXPORT const char *MEDCouplingByteOrderStr(); - class RefCountObject + class BigMemoryObject { - protected: - RefCountObject(); - RefCountObject(const RefCountObject& other); public: - MEDCOUPLING_EXPORT bool decrRef() const; - MEDCOUPLING_EXPORT void incrRef() const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySize() const; MEDCOUPLING_EXPORT std::string getHeapMemorySizeStr() const; MEDCOUPLING_EXPORT virtual std::size_t getHeapMemorySizeWithoutChildren() const = 0; - MEDCOUPLING_EXPORT virtual std::vector getDirectChildren() const = 0; + MEDCOUPLING_EXPORT virtual std::vector getDirectChildren() const = 0; + MEDCOUPLING_EXPORT virtual ~BigMemoryObject(); + }; + + class RefCountObjectOnly + { + protected: + RefCountObjectOnly(); + RefCountObjectOnly(const RefCountObjectOnly& other); + public: + MEDCOUPLING_EXPORT bool decrRef() const; + MEDCOUPLING_EXPORT void incrRef() const; MEDCOUPLING_EXPORT int getRCValue() const; - MEDCOUPLING_EXPORT RefCountObject& operator=(const RefCountObject& other); + MEDCOUPLING_EXPORT RefCountObjectOnly& operator=(const RefCountObjectOnly& other); protected: - virtual ~RefCountObject(); + virtual ~RefCountObjectOnly(); private: mutable int _cnt; }; + + class RefCountObject : public RefCountObjectOnly, public BigMemoryObject + { + protected: + RefCountObject(); + RefCountObject(const RefCountObject& other); + virtual ~RefCountObject(); + }; } #endif diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx index 7bc366262..9921f7de6 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.cxx @@ -99,11 +99,11 @@ std::size_t MEDCouplingTimeDiscretization::getHeapMemorySizeWithoutChildren() co return ret; } -std::vector MEDCouplingTimeDiscretization::getDirectChildren() const +std::vector MEDCouplingTimeDiscretization::getDirectChildren() const { - std::vector ret; + std::vector ret; if(_array) - ret.push_back(const_cast(_array)); + ret.push_back(_array); return ret; } @@ -2219,11 +2219,11 @@ std::size_t MEDCouplingTwoTimeSteps::getHeapMemorySizeWithoutChildren() const return MEDCouplingTimeDiscretization::getHeapMemorySizeWithoutChildren(); } -std::vector MEDCouplingTwoTimeSteps::getDirectChildren() const +std::vector MEDCouplingTwoTimeSteps::getDirectChildren() const { - std::vector ret(MEDCouplingTimeDiscretization::getDirectChildren()); + std::vector ret(MEDCouplingTimeDiscretization::getDirectChildren()); if(_end_array) - ret.push_back(const_cast(_end_array)); + ret.push_back(_end_array); return ret; } diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx index 15641eabf..34b04208e 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx @@ -34,7 +34,7 @@ namespace ParaMEDMEM class DataArrayDouble; class TimeLabel; - class MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization : public TimeLabel + class MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization : public TimeLabel, public BigMemoryObject { protected: MEDCouplingTimeDiscretization(); @@ -42,7 +42,7 @@ namespace ParaMEDMEM public: void updateTime() const; virtual std::size_t getHeapMemorySizeWithoutChildren() const; - virtual std::vector getDirectChildren() const; + virtual std::vector getDirectChildren() const; static MEDCouplingTimeDiscretization *New(TypeOfTimeDiscretization type) throw(INTERP_KERNEL::Exception); void setTimeUnit(const char *unit) { _time_unit=unit; } const char *getTimeUnit() const { return _time_unit.c_str(); } @@ -369,7 +369,7 @@ namespace ParaMEDMEM void updateTime() const; void synchronizeTimeWith(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; void copyTinyAttrFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception); void copyTinyStringsFrom(const MEDCouplingTimeDiscretization& other) throw(INTERP_KERNEL::Exception); const DataArrayDouble *getEndArray() const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDCoupling/MEDCouplingUMesh.cxx b/src/MEDCoupling/MEDCouplingUMesh.cxx index 53dd0d55f..7f8032783 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.cxx +++ b/src/MEDCoupling/MEDCouplingUMesh.cxx @@ -121,13 +121,13 @@ std::size_t MEDCouplingUMesh::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDCouplingUMesh::getDirectChildren() const +std::vector MEDCouplingUMesh::getDirectChildren() const { - std::vector ret(MEDCouplingPointSet::getDirectChildren()); + std::vector ret(MEDCouplingPointSet::getDirectChildren()); if(_nodal_connec) - ret.push_back(const_cast(_nodal_connec)); + ret.push_back(_nodal_connec); if(_nodal_connec_index) - ret.push_back(const_cast(_nodal_connec_index)); + ret.push_back(_nodal_connec_index); return ret; } diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index 4c75c0af5..e11d0c993 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -47,7 +47,7 @@ namespace ParaMEDMEM MEDCOUPLING_EXPORT void shallowCopyConnectivityFrom(const MEDCouplingPointSet *other) throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT void updateTime() const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDCOUPLING_EXPORT std::vector getDirectChildren() const; + MEDCOUPLING_EXPORT std::vector getDirectChildren() const; MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const { return UNSTRUCTURED; } MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingMesh *other, double prec, std::string& reason) const throw(INTERP_KERNEL::Exception); MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingMesh *other, double prec) const; diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index df1fa3a07..4d746d201 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -558,18 +558,41 @@ namespace ParaMEDMEM bool MEDCouplingByteOrder(); const char *MEDCouplingByteOrderStr(); - class RefCountObject + class BigMemoryObject + { + public: + std::size_t getHeapMemorySize() const; + std::string getHeapMemorySizeStr() const; + virtual std::size_t getHeapMemorySizeWithoutChildren() const; + virtual ~BigMemoryObject(); + %extend + { + virtual PyObject *getDirectChildren() const + { + std::vector c(self->getDirectChildren()); + PyObject *ret(PyList_New(c.size())); + for(std::size_t i=0;i MEDFileData::getDirectChildren() const +std::vector MEDFileData::getDirectChildren() const { - std::vector ret; + std::vector ret; if((const MEDFileFields *)_fields) - ret.push_back(const_cast((const MEDFileFields *)_fields)); + ret.push_back((const MEDFileFields *)_fields); if((const MEDFileMeshes *)_meshes) - ret.push_back(const_cast((const MEDFileMeshes *)_meshes)); + ret.push_back((const MEDFileMeshes *)_meshes); if((const MEDFileParameters *)_params) - ret.push_back(const_cast((const MEDFileParameters *)_params)); + ret.push_back((const MEDFileParameters *)_params); return ret; } diff --git a/src/MEDLoader/MEDFileData.hxx b/src/MEDLoader/MEDFileData.hxx index 31411500e..22322021b 100644 --- a/src/MEDLoader/MEDFileData.hxx +++ b/src/MEDLoader/MEDFileData.hxx @@ -38,7 +38,7 @@ namespace ParaMEDMEM static MEDFileData *New(); MEDFileData *deepCpy() const throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileFields *getFields() const; MEDFileMeshes *getMeshes() const; MEDFileParameters *getParams() const; diff --git a/src/MEDLoader/MEDFileField.cxx b/src/MEDLoader/MEDFileField.cxx index 0a712f93c..13d1a7f21 100644 --- a/src/MEDLoader/MEDFileField.cxx +++ b/src/MEDLoader/MEDFileField.cxx @@ -114,9 +114,9 @@ std::size_t MEDFileFieldLoc::getHeapMemorySizeWithoutChildren() const return (_ref_coo.capacity()+_gs_coo.capacity()+_w.capacity())*sizeof(double)+_name.capacity(); } -std::vector MEDFileFieldLoc::getDirectChildren() const +std::vector MEDFileFieldLoc::getDirectChildren() const { - return std::vector(); + return std::vector(); } void MEDFileFieldLoc::simpleRepr(std::ostream& oss) const @@ -412,9 +412,9 @@ std::size_t MEDFileFieldPerMeshPerTypePerDisc::getHeapMemorySizeWithoutChildren( return _profile.capacity()+_localization.capacity()+5*sizeof(int); } -std::vector MEDFileFieldPerMeshPerTypePerDisc::getDirectChildren() const +std::vector MEDFileFieldPerMeshPerTypePerDisc::getDirectChildren() const { - return std::vector(); + return std::vector(); } MEDFileFieldPerMeshPerTypePerDisc *MEDFileFieldPerMeshPerTypePerDisc::deepCpy(MEDFileFieldPerMeshPerType *father) const throw(INTERP_KERNEL::Exception) @@ -983,14 +983,14 @@ std::size_t MEDFileFieldPerMeshPerType::getHeapMemorySizeWithoutChildren() const return _field_pm_pt_pd.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr); } -std::vector MEDFileFieldPerMeshPerType::getDirectChildren() const +std::vector MEDFileFieldPerMeshPerType::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_field_pm_pt_pd.begin();it!=_field_pm_pt_pd.end();it++) { const MEDFileFieldPerMeshPerTypePerDisc *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } return ret; } @@ -1545,14 +1545,14 @@ std::size_t MEDFileFieldPerMesh::getHeapMemorySizeWithoutChildren() const return _mesh_name.capacity()+_field_pm_pt.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType >); } -std::vector MEDFileFieldPerMesh::getDirectChildren() const +std::vector MEDFileFieldPerMesh::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMeshPerType > >::const_iterator it=_field_pm_pt.begin();it!=_field_pm_pt.end();it++) { const MEDFileFieldPerMeshPerType *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } return ret; } @@ -2534,20 +2534,20 @@ std::size_t MEDFileFieldGlobs::getHeapMemorySizeWithoutChildren() const return _file_name.capacity()+_pfls.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr)+_locs.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr); } -std::vector MEDFileFieldGlobs::getDirectChildren() const +std::vector MEDFileFieldGlobs::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr< DataArrayInt > >::const_iterator it=_pfls.begin();it!=_pfls.end();it++) { const DataArrayInt *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_locs.begin();it!=_locs.end();it++) { const MEDFileFieldLoc *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } return ret; } @@ -3003,11 +3003,11 @@ std::size_t MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector MEDFileFieldGlobsReal::getDirectChildren() const +std::vector MEDFileFieldGlobsReal::getDirectChildren() const { - std::vector ret; + std::vector ret; if((const MEDFileFieldGlobs *)_globals) - ret.push_back(const_cast((const MEDFileFieldGlobs *)_globals)); + ret.push_back((const MEDFileFieldGlobs *)_globals); return ret; } @@ -4237,16 +4237,16 @@ std::size_t MEDFileAnyTypeField1TSWithoutSDA::getHeapMemorySizeWithoutChildren() return _dt_unit.capacity()+_field_per_mesh.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh >); } -std::vector MEDFileAnyTypeField1TSWithoutSDA::getDirectChildren() const +std::vector MEDFileAnyTypeField1TSWithoutSDA::getDirectChildren() const { - std::vector ret; + std::vector ret; if(getUndergroundDataArray()) - ret.push_back(const_cast(getUndergroundDataArray())); + ret.push_back(getUndergroundDataArray()); for(std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileFieldPerMesh > >::const_iterator it=_field_per_mesh.begin();it!=_field_per_mesh.end();it++) { const MEDFileFieldPerMesh *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } return ret; } @@ -5623,11 +5623,11 @@ std::size_t MEDFileAnyTypeField1TS::getHeapMemorySizeWithoutChildren() const return MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren(); } -std::vector MEDFileAnyTypeField1TS::getDirectChildren() const +std::vector MEDFileAnyTypeField1TS::getDirectChildren() const { - std::vector ret(MEDFileFieldGlobsReal::getDirectChildren()); + std::vector ret(MEDFileFieldGlobsReal::getDirectChildren()); if((const MEDFileAnyTypeField1TSWithoutSDA *)_content) - ret.push_back(const_cast((const MEDFileAnyTypeField1TSWithoutSDA *)_content)); + ret.push_back((const MEDFileAnyTypeField1TSWithoutSDA *)_content); return ret; } @@ -6730,14 +6730,14 @@ std::size_t MEDFileAnyTypeFieldMultiTSWithoutSDA::getHeapMemorySizeWithoutChildr return ret; } -std::vector MEDFileAnyTypeFieldMultiTSWithoutSDA::getDirectChildren() const +std::vector MEDFileAnyTypeFieldMultiTSWithoutSDA::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_time_steps.begin();it!=_time_steps.end();it++) { const MEDFileAnyTypeField1TSWithoutSDA *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } return ret; } @@ -8189,11 +8189,11 @@ std::size_t MEDFileAnyTypeFieldMultiTS::getHeapMemorySizeWithoutChildren() const return MEDFileFieldGlobsReal::getHeapMemorySizeWithoutChildren(); } -std::vector MEDFileAnyTypeFieldMultiTS::getDirectChildren() const +std::vector MEDFileAnyTypeFieldMultiTS::getDirectChildren() const { - std::vector ret(MEDFileFieldGlobsReal::getDirectChildren()); + std::vector ret(MEDFileFieldGlobsReal::getDirectChildren()); if((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content) - ret.push_back(const_cast((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content)); + ret.push_back((const MEDFileAnyTypeFieldMultiTSWithoutSDA *)_content); return ret; } @@ -9363,14 +9363,14 @@ std::size_t MEDFileFields::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDFileFields::getDirectChildren() const +std::vector MEDFileFields::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_fields.begin();it!=_fields.end();it++) { const MEDFileAnyTypeFieldMultiTSWithoutSDA *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } return ret; } diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index 38a6ae1e5..21f459489 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -56,7 +56,7 @@ namespace ParaMEDMEM static MEDFileFieldLoc *New(med_idt fid, int id); static MEDFileFieldLoc *New(const char *locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector& refCoo, const std::vector& gsCoo, const std::vector& w); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileFieldLoc *deepCpy() const; int MEDLOADER_EXPORT getNbOfGaussPtPerCell() const { return _nb_gauss_pt; } void MEDLOADER_EXPORT writeLL(med_idt fid) const; @@ -99,7 +99,7 @@ namespace ParaMEDMEM static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerType *fath, TypeOfField type, int locId); static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileFieldPerMeshPerTypePerDisc *deepCpy(MEDFileFieldPerMeshPerType *father) const throw(INTERP_KERNEL::Exception); void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arrr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); void assignFieldProfile(int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arrr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); @@ -175,7 +175,7 @@ namespace ParaMEDMEM static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType) throw(INTERP_KERNEL::Exception); static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileFieldPerMeshPerType *deepCpy(MEDFileFieldPerMesh *father) const throw(INTERP_KERNEL::Exception); void assignFieldNoProfile(int& start, int offset, int nbOfCells, const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); void assignFieldProfile(int& start, const DataArrayInt *multiTypePfl, const DataArrayInt *idsInPfl, DataArrayInt *locIds, int nbOfEltsInWholeMesh, const MEDCouplingFieldDouble *field, const DataArray *arr, const MEDCouplingMesh *mesh, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); @@ -231,7 +231,7 @@ namespace ParaMEDMEM static MEDFileFieldPerMesh *New(MEDFileAnyTypeField1TSWithoutSDA *fath, const MEDCouplingMesh *mesh); static MEDFileFieldPerMesh *NewOnRead(med_idt fid, MEDFileAnyTypeField1TSWithoutSDA *fath, int meshCsit, int meshIteration, int meshOrder, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileFieldPerMesh *deepCpy(MEDFileAnyTypeField1TSWithoutSDA *father) const throw(INTERP_KERNEL::Exception); void simpleRepr(int bkOffset,std::ostream& oss, int id) const; void copyTinyInfoFrom(const MEDCouplingMesh *mesh) throw(INTERP_KERNEL::Exception); @@ -305,7 +305,7 @@ namespace ParaMEDMEM static MEDFileFieldGlobs *New(const char *fname); static MEDFileFieldGlobs *New(); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileFieldGlobs *deepCpy() const throw(INTERP_KERNEL::Exception); MEDFileFieldGlobs *shallowCpyPart(const std::vector& pfls, const std::vector& locs) const throw(INTERP_KERNEL::Exception); MEDFileFieldGlobs *deepCpyPart(const std::vector& pfls, const std::vector& locs) const throw(INTERP_KERNEL::Exception); @@ -366,7 +366,7 @@ namespace ParaMEDMEM MEDFileFieldGlobsReal(const char *fname); MEDFileFieldGlobsReal(); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; void simpleReprGlobs(std::ostream& oss) const; void resetContent(); void shallowCpyGlobs(const MEDFileFieldGlobsReal& other); @@ -489,7 +489,7 @@ namespace ParaMEDMEM std::vector& getInfo(); void setInfo(const std::vector& infos) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; int copyTinyInfoFrom(const MEDCouplingFieldDouble *field, const DataArray *arr) throw(INTERP_KERNEL::Exception); void setFieldNoProfileSBT(const MEDCouplingFieldDouble *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); void setFieldProfile(const MEDCouplingFieldDouble *field, const DataArray *arrOfVals, const MEDFileMesh *mesh, int meshDimRelToMax, const DataArrayInt *profile, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc) throw(INTERP_KERNEL::Exception); @@ -674,7 +674,7 @@ namespace ParaMEDMEM //! underground method see MEDFileField1TSWithoutSDA::setLocNameOnLeaf void setLocNameOnLeaf(const char *mName, INTERP_KERNEL::NormalizedCellType typ, int locId, const char *newLocName, bool forceRenameOnGlob=false) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; std::vector getPflsReallyUsed() const; std::vector getLocsReallyUsed() const; std::vector getPflsReallyUsedMulti() const; @@ -783,7 +783,7 @@ namespace ParaMEDMEM MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const char *fieldName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll) throw(INTERP_KERNEL::Exception); public: std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCpy() const throw(INTERP_KERNEL::Exception); virtual std::vector< MEDCouplingAutoRefCountObjectPtr > splitComponents() const throw(INTERP_KERNEL::Exception); virtual std::vector< MEDCouplingAutoRefCountObjectPtr > splitDiscretizations() const throw(INTERP_KERNEL::Exception); @@ -914,7 +914,7 @@ namespace ParaMEDMEM void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); void writeLL(med_idt fid) const throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; virtual MEDFileAnyTypeFieldMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception); std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitComponents() const throw(INTERP_KERNEL::Exception); std::vector< MEDCouplingAutoRefCountObjectPtr< MEDFileAnyTypeFieldMultiTS > > splitDiscretizations() const throw(INTERP_KERNEL::Exception); @@ -1075,7 +1075,7 @@ std::vector< std::vector > getFieldSplitedByType2(int iterati static MEDFileFields *New(); static MEDFileFields *New(const char *fileName, bool loadAll=true) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileFields *deepCpy() const throw(INTERP_KERNEL::Exception); MEDFileFields *shallowCpy() const throw(INTERP_KERNEL::Exception); void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/MEDFileFieldOverView.cxx b/src/MEDLoader/MEDFileFieldOverView.cxx index 21f86e452..a70e73953 100644 --- a/src/MEDLoader/MEDFileFieldOverView.cxx +++ b/src/MEDLoader/MEDFileFieldOverView.cxx @@ -45,9 +45,9 @@ std::size_t MEDFileMeshStruct::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDFileMeshStruct::getDirectChildren() const +std::vector MEDFileMeshStruct::getDirectChildren() const { - return std::vector(); + return std::vector(); } MEDFileMeshStruct::MEDFileMeshStruct(const MEDFileMesh *mesh):_mesh(mesh) @@ -114,9 +114,9 @@ std::size_t MEDMeshMultiLev::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector MEDMeshMultiLev::getDirectChildren() const +std::vector MEDMeshMultiLev::getDirectChildren() const { - return std::vector(); + return std::vector(); } MEDMeshMultiLev *MEDMeshMultiLev::New(const MEDFileMesh *m, const std::vector& levs) throw(INTERP_KERNEL::Exception) @@ -1175,12 +1175,12 @@ std::size_t MEDFileField1TSStructItem2::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDFileField1TSStructItem2::getDirectChildren() const +std::vector MEDFileField1TSStructItem2::getDirectChildren() const { - std::vector ret; + std::vector ret; const DataArrayInt *pfl(_pfl); if(pfl) - ret.push_back(const_cast(pfl)); + ret.push_back(pfl); return ret; } @@ -1392,11 +1392,11 @@ std::size_t MEDFileField1TSStructItem::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDFileField1TSStructItem::getDirectChildren() const +std::vector MEDFileField1TSStructItem::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDFileField1TSStructItem2 >::const_iterator it=_items.begin();it!=_items.end();it++) - ret.push_back(const_cast(&(*it))); + ret.push_back(&(*it)); return ret; } @@ -1550,11 +1550,11 @@ std::size_t MEDFileField1TSStruct::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDFileField1TSStruct::getDirectChildren() const +std::vector MEDFileField1TSStruct::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector::const_iterator it=_already_checked.begin();it!=_already_checked.end();it++) - ret.push_back(const_cast(&(*it))); + ret.push_back(&(*it)); return ret; } @@ -1675,17 +1675,17 @@ std::size_t MEDFileFastCellSupportComparator::getHeapMemorySizeWithoutChildren() return ret; } -std::vector MEDFileFastCellSupportComparator::getDirectChildren() const +std::vector MEDFileFastCellSupportComparator::getDirectChildren() const { - std::vector ret; + std::vector ret; const MEDFileMeshStruct *mst(_mesh_comp); if(mst) - ret.push_back(const_cast(mst)); + ret.push_back(mst); for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_f1ts_cmps.begin();it!=_f1ts_cmps.end();it++) { const MEDFileField1TSStruct *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } return ret; } diff --git a/src/MEDLoader/MEDFileFieldOverView.hxx b/src/MEDLoader/MEDFileFieldOverView.hxx index 9525e403a..7ffa3f14e 100644 --- a/src/MEDLoader/MEDFileFieldOverView.hxx +++ b/src/MEDLoader/MEDFileFieldOverView.hxx @@ -50,7 +50,7 @@ namespace ParaMEDMEM public: MEDLOADER_EXPORT static MEDFileMeshStruct *New(const MEDFileMesh *mesh); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; const MEDFileMesh *getTheMesh() const { return _mesh; } int getNumberOfNodes() const { return _nb_nodes; } int getNumberOfElemsOfGeoType(INTERP_KERNEL::NormalizedCellType t) const throw(INTERP_KERNEL::Exception); @@ -72,7 +72,7 @@ namespace ParaMEDMEM { public: std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; public: static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities) throw(INTERP_KERNEL::Exception); static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector& levs) throw(INTERP_KERNEL::Exception); @@ -167,7 +167,7 @@ namespace ParaMEDMEM std::vector _structure; }; - class MEDFileField1TSStructItem2 : public RefCountObject + class MEDFileField1TSStructItem2 : public BigMemoryObject { public: MEDFileField1TSStructItem2(); @@ -177,7 +177,7 @@ namespace ParaMEDMEM void checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); // MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildren() const; // const DataArrayInt *getPfl(const MEDFileFieldGlobsReal *globs) const; INTERP_KERNEL::NormalizedCellType getGeo() const { return _geo_type; } @@ -202,7 +202,7 @@ namespace ParaMEDMEM int _nb_of_entity; }; - class MEDFileField1TSStructItem : public RefCountObject + class MEDFileField1TSStructItem : public BigMemoryObject { public: MEDFileField1TSStructItem() { } @@ -210,7 +210,7 @@ namespace ParaMEDMEM void checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); bool operator==(const MEDFileField1TSStructItem& other) const throw(INTERP_KERNEL::Exception); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; - MEDLOADER_EXPORT std::vector getDirectChildren() const; + MEDLOADER_EXPORT std::vector getDirectChildren() const; bool isEntityCell() const; bool isComputed() const { return _computed; } TypeOfField getType() const { return _type; } @@ -236,7 +236,7 @@ namespace ParaMEDMEM static MEDFileField1TSStruct *New(const MEDFileAnyTypeField1TS *ref, MEDFileMeshStruct *mst) throw(INTERP_KERNEL::Exception); void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; bool isEqualConsideringThePast(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *mst) const throw(INTERP_KERNEL::Exception); bool isSupportSameAs(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception); bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt) throw(INTERP_KERNEL::Exception); @@ -259,7 +259,7 @@ namespace ParaMEDMEM bool isEqual(const MEDFileAnyTypeFieldMultiTS *other) throw(INTERP_KERNEL::Exception); bool isCompatibleWithNodesDiscr(const MEDFileAnyTypeFieldMultiTS *other) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; private: MEDFileFastCellSupportComparator(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref); private: diff --git a/src/MEDLoader/MEDFileMesh.cxx b/src/MEDLoader/MEDFileMesh.cxx index d6f11e227..b3853aa8c 100644 --- a/src/MEDLoader/MEDFileMesh.cxx +++ b/src/MEDLoader/MEDFileMesh.cxx @@ -54,9 +54,9 @@ std::size_t MEDFileMesh::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDFileMesh::getDirectChildren() const +std::vector MEDFileMesh::getDirectChildren() const { - return std::vector(); + return std::vector(); } /*! @@ -1932,22 +1932,22 @@ std::size_t MEDFileUMesh::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDFileUMesh::getDirectChildren() const +std::vector MEDFileUMesh::getDirectChildren() const { - std::vector ret(MEDFileMesh::getDirectChildren()); + std::vector ret(MEDFileMesh::getDirectChildren()); if((const DataArrayDouble*)_coords) - ret.push_back(const_cast((const DataArrayDouble*)_coords)); + ret.push_back((const DataArrayDouble*)_coords); if((const DataArrayInt *)_fam_coords) - ret.push_back(const_cast((const DataArrayInt *)_fam_coords)); + ret.push_back((const DataArrayInt *)_fam_coords); if((const DataArrayInt *)_num_coords) - ret.push_back(const_cast((const DataArrayInt *)_num_coords)); + ret.push_back((const DataArrayInt *)_num_coords); if((const DataArrayInt *)_rev_num_coords) - ret.push_back(const_cast((const DataArrayInt *)_rev_num_coords)); + ret.push_back((const DataArrayInt *)_rev_num_coords); if((const DataArrayAsciiChar *)_name_coords) - ret.push_back(const_cast((const DataArrayAsciiChar *)_name_coords)); + ret.push_back((const DataArrayAsciiChar *)_name_coords); for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_ms.begin();it!=_ms.end();it++) if((const MEDFileUMeshSplitL1*) *it) - ret.push_back(const_cast((const MEDFileUMeshSplitL1*) *it)); + ret.push_back((const MEDFileUMeshSplitL1*) *it); return ret; } @@ -3817,21 +3817,21 @@ std::size_t MEDFileStructuredMesh::getHeapMemorySizeWithoutChildren() const return MEDFileMesh::getHeapMemorySizeWithoutChildren(); } -std::vector MEDFileStructuredMesh::getDirectChildren() const +std::vector MEDFileStructuredMesh::getDirectChildren() const { - std::vector ret(MEDFileMesh::getDirectChildren()); + std::vector ret(MEDFileMesh::getDirectChildren()); if((const DataArrayInt *)_fam_nodes) - ret.push_back(const_cast((const DataArrayInt *)_fam_nodes)); + ret.push_back((const DataArrayInt *)_fam_nodes); if((const DataArrayInt *)_num_nodes) - ret.push_back(const_cast((const DataArrayInt *)_num_nodes)); + ret.push_back((const DataArrayInt *)_num_nodes); if((const DataArrayInt *)_fam_cells) - ret.push_back(const_cast((const DataArrayInt *)_fam_cells)); + ret.push_back((const DataArrayInt *)_fam_cells); if((const DataArrayInt *)_num_cells) - ret.push_back(const_cast((const DataArrayInt *)_num_nodes)); + ret.push_back((const DataArrayInt *)_num_nodes); if((const DataArrayInt *)_rev_num_nodes) - ret.push_back(const_cast((const DataArrayInt *)_rev_num_nodes)); + ret.push_back((const DataArrayInt *)_rev_num_nodes); if((const DataArrayInt *)_rev_num_cells) - ret.push_back(const_cast((const DataArrayInt *)_rev_num_cells)); + ret.push_back((const DataArrayInt *)_rev_num_cells); return ret; } @@ -4615,11 +4615,11 @@ std::size_t MEDFileCMesh::getHeapMemorySizeWithoutChildren() const return MEDFileStructuredMesh::getHeapMemorySizeWithoutChildren(); } -std::vector MEDFileCMesh::getDirectChildren() const +std::vector MEDFileCMesh::getDirectChildren() const { - std::vector ret(MEDFileStructuredMesh::getDirectChildren()); + std::vector ret(MEDFileStructuredMesh::getDirectChildren()); if((const MEDCouplingCMesh *)_cmesh) - ret.push_back(const_cast((const MEDCouplingCMesh *)_cmesh)); + ret.push_back((const MEDCouplingCMesh *)_cmesh); return ret; } @@ -4860,11 +4860,11 @@ std::size_t MEDFileCurveLinearMesh::getHeapMemorySizeWithoutChildren() const return MEDFileStructuredMesh::getHeapMemorySizeWithoutChildren(); } -std::vector MEDFileCurveLinearMesh::getDirectChildren() const +std::vector MEDFileCurveLinearMesh::getDirectChildren() const { - std::vector ret(MEDFileStructuredMesh::getDirectChildren()); + std::vector ret(MEDFileStructuredMesh::getDirectChildren()); if((const MEDCouplingCurveLinearMesh *)_clmesh) - ret.push_back(const_cast((const MEDCouplingCurveLinearMesh *)_clmesh)); + ret.push_back((const MEDCouplingCurveLinearMesh *)_clmesh); return ret; } @@ -5072,14 +5072,14 @@ std::size_t MEDFileMeshMultiTS::getHeapMemorySizeWithoutChildren() const return _mesh_one_ts.capacity()*sizeof(MEDCouplingAutoRefCountObjectPtr); } -std::vector MEDFileMeshMultiTS::getDirectChildren() const +std::vector MEDFileMeshMultiTS::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_mesh_one_ts.begin();it!=_mesh_one_ts.end();it++) { const MEDFileMesh *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } return ret; } @@ -5357,14 +5357,14 @@ std::size_t MEDFileMeshes::getHeapMemorySizeWithoutChildren() const return _meshes.capacity()*(sizeof(MEDCouplingAutoRefCountObjectPtr)); } -std::vector MEDFileMeshes::getDirectChildren() const +std::vector MEDFileMeshes::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_meshes.begin();it!=_meshes.end();it++) { const MEDFileMeshMultiTS *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } return ret; } diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index 742ad47c7..643bac793 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -40,7 +40,7 @@ namespace ParaMEDMEM static MEDFileMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; virtual MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception) = 0; virtual MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception) = 0; virtual MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception) = 0; @@ -193,7 +193,7 @@ namespace ParaMEDMEM static MEDFileUMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileUMesh *New(); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception); MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception); MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception); @@ -291,7 +291,7 @@ namespace ParaMEDMEM friend class MEDFileMesh; public: std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; int getMaxAbsFamilyIdInArrays() const throw(INTERP_KERNEL::Exception); int getMaxFamilyIdInArrays() const throw(INTERP_KERNEL::Exception); int getMinFamilyIdInArrays() const throw(INTERP_KERNEL::Exception); @@ -342,7 +342,7 @@ namespace ParaMEDMEM static MEDFileCMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileCMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception); MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception); MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception); @@ -372,7 +372,7 @@ namespace ParaMEDMEM static MEDFileCurveLinearMesh *New(const char *fileName, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); static MEDFileCurveLinearMesh *New(const char *fileName, const char *mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileMesh *createNewEmpty() const throw(INTERP_KERNEL::Exception); MEDFileMesh *deepCpy() const throw(INTERP_KERNEL::Exception); MEDFileMesh *shallowCpy() const throw(INTERP_KERNEL::Exception); @@ -402,7 +402,7 @@ namespace ParaMEDMEM static MEDFileMeshMultiTS *New(const char *fileName, const char *mName) throw(INTERP_KERNEL::Exception); MEDFileMeshMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; std::string getName() const throw(INTERP_KERNEL::Exception); void setName(const char *newMeshName) throw(INTERP_KERNEL::Exception); bool changeNames(const std::vector< std::pair >& modifTab) throw(INTERP_KERNEL::Exception); @@ -428,7 +428,7 @@ namespace ParaMEDMEM static MEDFileMeshes *New(const char *fileName) throw(INTERP_KERNEL::Exception); MEDFileMeshes *deepCpy() const throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; std::string simpleRepr() const; void simpleReprWithoutHeader(std::ostream& oss) const; void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/MEDFileMeshElt.cxx b/src/MEDLoader/MEDFileMeshElt.cxx index 5bad3f8d9..537ceb64a 100644 --- a/src/MEDLoader/MEDFileMeshElt.cxx +++ b/src/MEDLoader/MEDFileMeshElt.cxx @@ -45,17 +45,17 @@ std::size_t MEDFileUMeshPerType::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector MEDFileUMeshPerType::getDirectChildren() const +std::vector MEDFileUMeshPerType::getDirectChildren() const { - std::vector ret; + std::vector ret; if((const MEDCoupling1GTUMesh *)_m) - ret.push_back(const_cast((const MEDCoupling1GTUMesh *)_m)); + ret.push_back((const MEDCoupling1GTUMesh *)_m); if((const DataArrayInt *)_num) - ret.push_back(const_cast((const DataArrayInt *)_num)); + ret.push_back((const DataArrayInt *)_num); if((const DataArrayInt *)_fam) - ret.push_back(const_cast((const DataArrayInt *)_fam)); + ret.push_back((const DataArrayInt *)_fam); if((const DataArrayAsciiChar *)_names) - ret.push_back(const_cast((const DataArrayAsciiChar *)_names)); + ret.push_back((const DataArrayAsciiChar *)_names); return ret; } diff --git a/src/MEDLoader/MEDFileMeshElt.hxx b/src/MEDLoader/MEDFileMeshElt.hxx index ee3ccda98..0868cf757 100644 --- a/src/MEDLoader/MEDFileMeshElt.hxx +++ b/src/MEDLoader/MEDFileMeshElt.hxx @@ -40,7 +40,7 @@ namespace ParaMEDMEM static MEDFileUMeshPerType *New(med_idt fid, const char *mName, int dt, int it, int mdim, med_geometry_type geoElt, INTERP_KERNEL::NormalizedCellType geoElt2, MEDFileMeshReadSelector *mrs); static bool isExisting(med_idt fid, const char *mName, int dt, int it, med_geometry_type geoElt, med_entity_type& whichEntity); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; int getDim() const; MEDCoupling1GTUMesh *getMesh() const { return const_cast((const MEDCoupling1GTUMesh *)_m); } const DataArrayInt *getFam() const { return _fam; } diff --git a/src/MEDLoader/MEDFileMeshLL.cxx b/src/MEDLoader/MEDFileMeshLL.cxx index ad8c2dae0..ef7f11d77 100644 --- a/src/MEDLoader/MEDFileMeshLL.cxx +++ b/src/MEDLoader/MEDFileMeshLL.cxx @@ -45,9 +45,9 @@ std::size_t MEDFileMeshL2::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector MEDFileMeshL2::getDirectChildren() const +std::vector MEDFileMeshL2::getDirectChildren() const { - return std::vector(); + return std::vector(); } int MEDFileMeshL2::GetMeshIdFromName(med_idt fid, const char *mname, ParaMEDMEM::MEDCouplingMeshType& meshType, int& dt, int& it, std::string& dtunit1) throw(INTERP_KERNEL::Exception) @@ -567,18 +567,18 @@ std::size_t MEDFileUMeshSplitL1::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector MEDFileUMeshSplitL1::getDirectChildren() const +std::vector MEDFileUMeshSplitL1::getDirectChildren() const { - std::vector ret; - ret.push_back(const_cast(&_m_by_types)); + std::vector ret; + ret.push_back(&_m_by_types); if((const DataArrayInt*)_fam) - ret.push_back(const_cast((const DataArrayInt*)_fam)); + ret.push_back((const DataArrayInt*)_fam); if((const DataArrayInt*)_num) - ret.push_back(const_cast((const DataArrayInt*)_num)); + ret.push_back((const DataArrayInt*)_num); if((const DataArrayInt*)_rev_num) - ret.push_back(const_cast((const DataArrayInt*)_rev_num)); + ret.push_back((const DataArrayInt*)_rev_num); if((const DataArrayAsciiChar*)_names) - ret.push_back(const_cast((const DataArrayAsciiChar*)_names)); + ret.push_back((const DataArrayAsciiChar*)_names); return ret; } @@ -1078,18 +1078,18 @@ std::size_t MEDFileUMeshAggregateCompute::getHeapMemorySizeWithoutChildren() con return ret; } -std::vector MEDFileUMeshAggregateCompute::getDirectChildren() const +std::vector MEDFileUMeshAggregateCompute::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_m_parts.begin();it!=_m_parts.end();it++) { const MEDCoupling1GTUMesh *cur(*it); if(cur) - ret.push_back(const_cast(cur)); + ret.push_back(cur); } const MEDCouplingUMesh *m(_m); if(m) - ret.push_back(const_cast(m)); + ret.push_back(m); return ret; } diff --git a/src/MEDLoader/MEDFileMeshLL.hxx b/src/MEDLoader/MEDFileMeshLL.hxx index a44312b40..90567eab0 100644 --- a/src/MEDLoader/MEDFileMeshLL.hxx +++ b/src/MEDLoader/MEDFileMeshLL.hxx @@ -43,7 +43,7 @@ namespace ParaMEDMEM public: MEDFileMeshL2(); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; const char *getName() const { return _name.getReprForWrite(); } const char *getDescription() const { return _description.getReprForWrite(); } const char *getUnivName() const { return _univ_name.getReprForWrite(); } @@ -137,7 +137,7 @@ namespace ParaMEDMEM mutable MEDCouplingAutoRefCountObjectPtr _m; }; - class MEDFileUMeshAggregateCompute : public RefCountObject + class MEDFileUMeshAggregateCompute : public BigMemoryObject { public: MEDFileUMeshAggregateCompute(); @@ -149,7 +149,7 @@ namespace ParaMEDMEM MEDCoupling1GTUMesh *getPartWithoutComputation(INTERP_KERNEL::NormalizedCellType gt) const throw(INTERP_KERNEL::Exception); std::size_t getTimeOfThis() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileUMeshAggregateCompute deepCpy(DataArrayDouble *coords) const; bool isEqual(const MEDFileUMeshAggregateCompute& other, double eps, std::string& what) const; void clearNonDiscrAttributes() const; @@ -179,7 +179,7 @@ namespace ParaMEDMEM MEDFileUMeshSplitL1(MEDCouplingUMesh *m); MEDFileUMeshSplitL1(MEDCouplingUMesh *m, bool newOrOld); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileUMeshSplitL1 *deepCpy(DataArrayDouble *coords) const; void setCoords(DataArrayDouble *coords) throw(INTERP_KERNEL::Exception); bool isEqual(const MEDFileUMeshSplitL1 *other, double eps, std::string& what) const; diff --git a/src/MEDLoader/MEDFileParameter.cxx b/src/MEDLoader/MEDFileParameter.cxx index ad675d51f..c2975f881 100644 --- a/src/MEDLoader/MEDFileParameter.cxx +++ b/src/MEDLoader/MEDFileParameter.cxx @@ -72,9 +72,9 @@ std::size_t MEDFileParameterDouble1TSWTI::getHeapMemorySizeWithoutChildren() con return sizeof(MEDFileParameterDouble1TSWTI); } -std::vector MEDFileParameterDouble1TSWTI::getDirectChildren() const +std::vector MEDFileParameterDouble1TSWTI::getDirectChildren() const { - return std::vector(); + return std::vector(); } std::string MEDFileParameterDouble1TSWTI::simpleRepr() const @@ -350,9 +350,9 @@ std::size_t MEDFileParameterDouble1TS::getHeapMemorySizeWithoutChildren() const return getHeapMemSizeOfStrings()+sizeof(MEDFileParameterDouble1TS); } -std::vector MEDFileParameterDouble1TS::getDirectChildren() const +std::vector MEDFileParameterDouble1TS::getDirectChildren() const { - return std::vector(); + return std::vector(); } void MEDFileParameterDouble1TS::write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception) @@ -486,14 +486,14 @@ std::size_t MEDFileParameterMultiTS::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDFileParameterMultiTS::getDirectChildren() const +std::vector MEDFileParameterMultiTS::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_param_per_ts.begin();it!=_param_per_ts.end();it++) { const MEDFileParameter1TS *elt(*it); if(elt) - ret.push_back(const_cast(elt)); + ret.push_back(elt); } return ret; } @@ -737,14 +737,14 @@ std::size_t MEDFileParameters::getHeapMemorySizeWithoutChildren() const return ret; } -std::vector MEDFileParameters::getDirectChildren() const +std::vector MEDFileParameters::getDirectChildren() const { - std::vector ret; + std::vector ret; for(std::vector< MEDCouplingAutoRefCountObjectPtr >::const_iterator it=_params.begin();it!=_params.end();it++) { const MEDFileParameterMultiTS *elt(*it); if(elt) - ret.push_back(const_cast(elt)); + ret.push_back(elt); } return ret; } diff --git a/src/MEDLoader/MEDFileParameter.hxx b/src/MEDLoader/MEDFileParameter.hxx index 21240cb0b..6e975428e 100644 --- a/src/MEDLoader/MEDFileParameter.hxx +++ b/src/MEDLoader/MEDFileParameter.hxx @@ -63,7 +63,7 @@ namespace ParaMEDMEM double getValue() const throw(INTERP_KERNEL::Exception) { return _arr; } bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; void readValue(med_idt fid, const std::string& name) throw(INTERP_KERNEL::Exception); std::string simpleRepr() const; protected: @@ -106,7 +106,7 @@ namespace ParaMEDMEM virtual bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const; virtual std::string simpleRepr() const; std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; void setName(const char *name) throw(INTERP_KERNEL::Exception) { _name=name; } std::string getName() const throw(INTERP_KERNEL::Exception) { return _name; } void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); @@ -126,7 +126,7 @@ namespace ParaMEDMEM std::string getName() const { return _name; } void setName(const char *name) { _name=name; } std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileParameterMultiTS *deepCpy() const throw(INTERP_KERNEL::Exception); bool isEqual(const MEDFileParameterMultiTS *other, double eps, std::string& what) const; void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); @@ -157,7 +157,7 @@ namespace ParaMEDMEM static MEDFileParameters *New(); static MEDFileParameters *New(const char *fileName) throw(INTERP_KERNEL::Exception); std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; MEDFileParameters *deepCpy() const throw(INTERP_KERNEL::Exception); bool isEqual(const MEDFileParameters *other, double eps, std::string& what) const; void write(const char *fileName, int mode) const throw(INTERP_KERNEL::Exception); diff --git a/src/MEDLoader/SauvReader.cxx b/src/MEDLoader/SauvReader.cxx index 65093499c..4723db57e 100644 --- a/src/MEDLoader/SauvReader.cxx +++ b/src/MEDLoader/SauvReader.cxx @@ -86,9 +86,9 @@ std::size_t SauvReader::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector SauvReader::getDirectChildren() const +std::vector SauvReader::getDirectChildren() const { - return std::vector(); + return std::vector(); } //================================================================================ diff --git a/src/MEDLoader/SauvReader.hxx b/src/MEDLoader/SauvReader.hxx index 01b87d08e..d9c7b6379 100644 --- a/src/MEDLoader/SauvReader.hxx +++ b/src/MEDLoader/SauvReader.hxx @@ -52,7 +52,7 @@ class MEDLOADER_EXPORT SauvReader : public ParaMEDMEM::RefCountObject private: std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; void readRecord2(); void readRecord4(); void readRecord7(); diff --git a/src/MEDLoader/SauvUtilities.hxx b/src/MEDLoader/SauvUtilities.hxx index 25bec6d3b..7804ba44a 100644 --- a/src/MEDLoader/SauvUtilities.hxx +++ b/src/MEDLoader/SauvUtilities.hxx @@ -111,7 +111,7 @@ namespace SauvUtilities virtual std::string getName() const = 0; protected: std::size_t getHeapMemorySizeWithoutChildren() const { return 0; } - std::vector getDirectChildren() const { return std::vector(); } + std::vector getDirectChildren() const { return std::vector(); } protected: std::string _fileName, _curLocale; int _iRead, _nbToRead; diff --git a/src/MEDLoader/SauvWriter.cxx b/src/MEDLoader/SauvWriter.cxx index 908f7a504..0ff5777aa 100644 --- a/src/MEDLoader/SauvWriter.cxx +++ b/src/MEDLoader/SauvWriter.cxx @@ -228,9 +228,9 @@ std::size_t SauvWriter::getHeapMemorySizeWithoutChildren() const return 0; } -std::vector SauvWriter::getDirectChildren() const +std::vector SauvWriter::getDirectChildren() const { - return std::vector(); + return std::vector(); } //================================================================================ diff --git a/src/MEDLoader/SauvWriter.hxx b/src/MEDLoader/SauvWriter.hxx index 7f3b13fde..63a65b453 100644 --- a/src/MEDLoader/SauvWriter.hxx +++ b/src/MEDLoader/SauvWriter.hxx @@ -52,7 +52,7 @@ namespace ParaMEDMEM private: std::size_t getHeapMemorySizeWithoutChildren() const; - std::vector getDirectChildren() const; + std::vector getDirectChildren() const; /*! * \brief Class representing a GIBI sub-mesh (described in the pile 1 of the SAUVE file). * It stands for a named med sub-mesh (family, etc) and contains either cell IDs or other sub-meshes. -- 2.39.2