From: Anthony Geay Date: Fri, 21 Feb 2020 14:03:02 +0000 (+0100) Subject: Ease memory tracking X-Git-Tag: V9_5_0a1~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f014e72b8511050572b7020e545c3927d4e76732;p=tools%2Fmedcoupling.git Ease memory tracking --- diff --git a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx index 777d1dd97..30085dd8a 100644 --- a/src/MEDCoupling/MEDCoupling1GTUMesh.hxx +++ b/src/MEDCoupling/MEDCoupling1GTUMesh.hxx @@ -93,6 +93,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(const MEDCouplingUMesh *m); //! useless constructor only for CORBA -> not swigged MEDCOUPLING_EXPORT static MEDCoupling1SGTUMesh *New(); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCoupling1SGTUMesh"); } // Copy methods MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT MEDCoupling1SGTUMesh *deepCopy() const; @@ -192,6 +193,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(const MEDCouplingUMesh *m); //! useless constructor only for CORBA -> not swigged MEDCOUPLING_EXPORT static MEDCoupling1DGTUMesh *New(); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCoupling1DGTUMesh"); } // Copy methods MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT MEDCoupling1DGTUMesh *deepCopy() const; diff --git a/src/MEDCoupling/MEDCouplingAMRAttribute.hxx b/src/MEDCoupling/MEDCouplingAMRAttribute.hxx index 22497d538..76a91f02d 100644 --- a/src/MEDCoupling/MEDCouplingAMRAttribute.hxx +++ b/src/MEDCoupling/MEDCouplingAMRAttribute.hxx @@ -32,6 +32,7 @@ namespace MEDCoupling { public: static DataArrayDoubleCollection *New(const std::vector< std::pair >& fieldNames); + std::string getClassName() const override { return std::string("DataArrayDoubleCollection"); } DataArrayDoubleCollection *deepCopy() const; void allocTuples(mcIdType nbOfTuples); void dellocTuples(); @@ -71,6 +72,7 @@ namespace MEDCoupling { public: static MEDCouplingGridCollection *New(const std::vector& ms, const std::vector< std::pair >& fieldNames); + std::string getClassName() const override { return std::string("MEDCouplingGridCollection"); } MEDCouplingGridCollection *deepCopy(const MEDCouplingCartesianAMRMeshGen *newGf, const MEDCouplingCartesianAMRMeshGen *oldGf) const; void alloc(mcIdType ghostLev); void dealloc(); @@ -106,6 +108,7 @@ namespace MEDCoupling friend class MEDCouplingCartesianAMRMesh; public: MEDCOUPLING_EXPORT MEDCouplingCartesianAMRMesh *getMyGodFather(); + std::string getClassName() const override { return std::string("MEDCouplingDataForGodFather"); } MEDCOUPLING_EXPORT const MEDCouplingCartesianAMRMesh *getMyGodFather() const; MEDCOUPLING_EXPORT virtual void synchronizeFineToCoarse() = 0; MEDCOUPLING_EXPORT virtual void synchronizeFineToCoarseBetween(mcIdType fromLev, mcIdType toLev) = 0; @@ -133,6 +136,7 @@ namespace MEDCoupling public: MEDCOUPLING_EXPORT static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, const std::vector< std::pair >& fieldNames, mcIdType ghostLev); MEDCOUPLING_EXPORT static MEDCouplingAMRAttribute *New(MEDCouplingCartesianAMRMesh *gf, const std::vector< std::pair > >& fieldNames, mcIdType ghostLev); + std::string getClassName() const override { return std::string("MEDCouplingAMRAttribute"); } MEDCOUPLING_EXPORT void spillInfoOnComponents(const std::vector< std::vector >& compNames); MEDCOUPLING_EXPORT void spillNatures(const std::vector& nfs); MEDCOUPLING_EXPORT MEDCouplingAMRAttribute *deepCopy() const; diff --git a/src/MEDCoupling/MEDCouplingCMesh.hxx b/src/MEDCoupling/MEDCouplingCMesh.hxx index ae68dffb8..4baa65396 100644 --- a/src/MEDCoupling/MEDCouplingCMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCMesh.hxx @@ -33,6 +33,7 @@ namespace MEDCoupling public: MEDCOUPLING_EXPORT static MEDCouplingCMesh *New(); MEDCOUPLING_EXPORT static MEDCouplingCMesh *New(const std::string& meshName); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingCMesh"); } MEDCOUPLING_EXPORT MEDCouplingCMesh *deepCopy() const; MEDCOUPLING_EXPORT MEDCouplingCMesh *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT const DataArrayDouble *getDirectAccessOfCoordsArrIfInStructure() const; diff --git a/src/MEDCoupling/MEDCouplingCartesianAMRMesh.hxx b/src/MEDCoupling/MEDCouplingCartesianAMRMesh.hxx index cfe7aa4ab..81902f09b 100644 --- a/src/MEDCoupling/MEDCouplingCartesianAMRMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCartesianAMRMesh.hxx @@ -73,6 +73,7 @@ namespace MEDCoupling { public: MEDCouplingCartesianAMRPatch(MEDCouplingCartesianAMRMeshGen *mesh, const std::vector< std::pair >& bottomLeftTopRight); + std::string getClassName() const override { return std::string("MEDCouplingCartesianAMRPatch"); } MEDCouplingCartesianAMRPatch *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const; // direct forward to _mesh MEDCOUPLING_EXPORT void addPatch(const std::vector< std::pair >& bottomLeftTopRight, const std::vector& factors); @@ -116,6 +117,7 @@ namespace MEDCoupling { public: MEDCouplingCartesianAMRPatchGF(MEDCouplingCartesianAMRMesh *mesh); + std::string getClassName() const override { return std::string("MEDCouplingCartesianAMRPatchGF"); } MEDCouplingCartesianAMRPatchGF *deepCopy(MEDCouplingCartesianAMRMeshGen *father) const; private: std::size_t getHeapMemorySizeWithoutChildren() const; @@ -215,6 +217,7 @@ namespace MEDCoupling { public: MEDCouplingCartesianAMRMeshSub(MEDCouplingCartesianAMRMeshGen *father, MEDCouplingIMesh *mesh); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingCartesianAMRMeshSub"); } MEDCOUPLING_EXPORT const MEDCouplingCartesianAMRMeshGen *getFather() const; MEDCOUPLING_EXPORT const MEDCouplingCartesianAMRMeshGen *getGodFather() const; MEDCOUPLING_EXPORT mcIdType getAbsoluteLevel() const; @@ -235,6 +238,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT static MEDCouplingCartesianAMRMesh *New(const std::string& meshName, int spaceDim, const mcIdType *nodeStrctStart, const mcIdType *nodeStrctStop, const double *originStart, const double *originStop, const double *dxyzStart, const double *dxyzStop); MEDCOUPLING_EXPORT static MEDCouplingCartesianAMRMesh *New(MEDCouplingIMesh *mesh); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingCartesianAMRMesh"); } MEDCOUPLING_EXPORT const MEDCouplingCartesianAMRMeshGen *getFather() const; MEDCOUPLING_EXPORT const MEDCouplingCartesianAMRMeshGen *getGodFather() const; MEDCOUPLING_EXPORT mcIdType getAbsoluteLevel() const; diff --git a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx index c99730e36..937fcc6e0 100644 --- a/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx +++ b/src/MEDCoupling/MEDCouplingCurveLinearMesh.hxx @@ -32,6 +32,7 @@ namespace MEDCoupling public: MEDCOUPLING_EXPORT static MEDCouplingCurveLinearMesh *New(); MEDCOUPLING_EXPORT static MEDCouplingCurveLinearMesh *New(const std::string& meshName); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingCurveLinearMesh"); } MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *deepCopy() const; MEDCOUPLING_EXPORT MEDCouplingCurveLinearMesh *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT void updateTime() const; diff --git a/src/MEDCoupling/MEDCouplingDefinitionTime.hxx b/src/MEDCoupling/MEDCouplingDefinitionTime.hxx index 441e3b179..22dc26e2d 100644 --- a/src/MEDCoupling/MEDCouplingDefinitionTime.hxx +++ b/src/MEDCoupling/MEDCouplingDefinitionTime.hxx @@ -70,6 +70,7 @@ namespace MEDCoupling { public: static MEDCouplingDefinitionTimeSliceInst *New(const std::vector& tiI, const std::vector& tiD); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingDefinitionTimeSliceInst"); } MEDCouplingDefinitionTimeSlice *copy() const; bool isEqual(const MEDCouplingDefinitionTimeSlice& other, double eps) const; void getHotSpotsTime(std::vector& ret) const; @@ -93,6 +94,7 @@ namespace MEDCoupling { public: static MEDCouplingDefinitionTimeSliceCstOnTI *New(const std::vector& tiI, const std::vector& tiD); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingDefinitionTimeSliceCstOnTI"); } MEDCouplingDefinitionTimeSlice *copy() const; bool isEqual(const MEDCouplingDefinitionTimeSlice& other, double eps) const; void getHotSpotsTime(std::vector& ret) const; @@ -117,6 +119,7 @@ namespace MEDCoupling { public: static MEDCouplingDefinitionTimeSliceLT *New(const std::vector& tiI, const std::vector& tiD); + std::string getClassName() const override { return std::string("MEDCouplingDefinitionTimeSliceLT"); } MEDCouplingDefinitionTimeSlice *copy() const; bool isEqual(const MEDCouplingDefinitionTimeSlice& other, double eps) const; void getHotSpotsTime(std::vector& ret) const; diff --git a/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx b/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx index da7a4ca3d..07c5d5663 100644 --- a/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx +++ b/src/MEDCoupling/MEDCouplingFieldDiscretization.hxx @@ -123,6 +123,7 @@ namespace MEDCoupling { public: MEDCOUPLING_EXPORT TypeOfField getEnum() const; + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldDiscretizationP0"); } MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization *clone() const; MEDCOUPLING_EXPORT std::string getStringRepr() const; MEDCOUPLING_EXPORT const char *getRepr() const; @@ -182,6 +183,7 @@ namespace MEDCoupling { public: MEDCOUPLING_EXPORT TypeOfField getEnum() const; + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldDiscretizationP1"); } MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization *clone() const; MEDCOUPLING_EXPORT std::string getStringRepr() const; MEDCOUPLING_EXPORT const char *getRepr() const; @@ -235,6 +237,7 @@ namespace MEDCoupling public: MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationGauss(); MEDCOUPLING_EXPORT TypeOfField getEnum() const; + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldDiscretizationGauss"); } MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingFieldDiscretization *other, double eps, std::string& reason) const; MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingFieldDiscretization *other, double eps) const; MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization *clone() const; @@ -311,6 +314,7 @@ namespace MEDCoupling public: MEDCOUPLING_EXPORT MEDCouplingFieldDiscretizationGaussNE(); MEDCOUPLING_EXPORT TypeOfField getEnum() const; + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldDiscretizationGaussNE"); } MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization *clone() const; MEDCOUPLING_EXPORT std::string getStringRepr() const; MEDCOUPLING_EXPORT const char *getRepr() const; @@ -409,6 +413,7 @@ namespace MEDCoupling { public: MEDCOUPLING_EXPORT TypeOfField getEnum() const; + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldDiscretizationKriging"); } MEDCOUPLING_EXPORT const char *getRepr() const; MEDCOUPLING_EXPORT MEDCouplingFieldDiscretization *clone() const; MEDCOUPLING_EXPORT std::string getStringRepr() const; diff --git a/src/MEDCoupling/MEDCouplingFieldDouble.hxx b/src/MEDCoupling/MEDCouplingFieldDouble.hxx index ee88df0b4..d05396d3d 100644 --- a/src/MEDCoupling/MEDCouplingFieldDouble.hxx +++ b/src/MEDCoupling/MEDCouplingFieldDouble.hxx @@ -148,6 +148,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT const MEDCouplingFieldDouble &operator^=(const MEDCouplingFieldDouble& other); MEDCOUPLING_EXPORT static MEDCouplingFieldDouble *PowFields(const MEDCouplingFieldDouble *f1, const MEDCouplingFieldDouble *f2); MEDCOUPLING_EXPORT static std::string WriteVTK(const std::string& fileName, const std::vector& fs, bool isBinary=true); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldDouble"); } public: MEDCOUPLING_EXPORT const MEDCouplingTimeDiscretization *getTimeDiscretizationUnderGround() const { return timeDiscr(); } MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *getTimeDiscretizationUnderGround() { return timeDiscr(); } diff --git a/src/MEDCoupling/MEDCouplingFieldFloat.hxx b/src/MEDCoupling/MEDCouplingFieldFloat.hxx index 276f99783..42028a8f9 100644 --- a/src/MEDCoupling/MEDCouplingFieldFloat.hxx +++ b/src/MEDCoupling/MEDCouplingFieldFloat.hxx @@ -40,6 +40,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT MEDCouplingFieldFloat *deepCopy() const; MEDCOUPLING_EXPORT MEDCouplingFieldFloat *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *convertToDblField() const; + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldFloat"); } protected: MEDCouplingFieldFloat(TypeOfField type, TypeOfTimeDiscretization td); MEDCouplingFieldFloat(const MEDCouplingFieldFloat& other, bool deepCpy); diff --git a/src/MEDCoupling/MEDCouplingFieldInt.hxx b/src/MEDCoupling/MEDCouplingFieldInt.hxx index f661334dd..845023136 100644 --- a/src/MEDCoupling/MEDCouplingFieldInt.hxx +++ b/src/MEDCoupling/MEDCouplingFieldInt.hxx @@ -40,6 +40,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT MEDCouplingFieldInt *deepCopy() const; MEDCOUPLING_EXPORT MEDCouplingFieldInt *clone(bool recDeepCpy) const; MEDCOUPLING_EXPORT MEDCouplingFieldDouble *convertToDblField() const; + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldInt"); } protected: MEDCouplingFieldInt(TypeOfField type, TypeOfTimeDiscretization td); MEDCouplingFieldInt(const MEDCouplingFieldInt& other, bool deepCopy); diff --git a/src/MEDCoupling/MEDCouplingFieldTemplate.hxx b/src/MEDCoupling/MEDCouplingFieldTemplate.hxx index 082dcc36a..8580b6130 100644 --- a/src/MEDCoupling/MEDCouplingFieldTemplate.hxx +++ b/src/MEDCoupling/MEDCouplingFieldTemplate.hxx @@ -48,6 +48,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldDouble& f); MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldFloat& f); MEDCOUPLING_EXPORT static MEDCouplingFieldTemplate *NewWithoutCheck(const MEDCouplingFieldInt& f); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingFieldTemplate"); } MEDCOUPLING_EXPORT bool isEqualIfNotWhy(const MEDCouplingFieldTemplate *other, double meshPrec, std::string& reason) const; MEDCOUPLING_EXPORT bool isEqual(const MEDCouplingFieldTemplate *other, double meshPrec) const; MEDCOUPLING_EXPORT bool isEqualWithoutConsideringStr(const MEDCouplingFieldTemplate *other, double meshPrec) const; diff --git a/src/MEDCoupling/MEDCouplingIMesh.hxx b/src/MEDCoupling/MEDCouplingIMesh.hxx index 51acdd9f7..7066824c2 100644 --- a/src/MEDCoupling/MEDCouplingIMesh.hxx +++ b/src/MEDCoupling/MEDCouplingIMesh.hxx @@ -34,6 +34,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT static MEDCouplingIMesh *New(); MEDCOUPLING_EXPORT static MEDCouplingIMesh *New(const std::string& meshName, int spaceDim, const mcIdType *nodeStrctStart, const mcIdType *nodeStrctStop, const double *originStart, const double *originStop, const double *dxyzStart, const double *dxyzStop); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingIMesh"); } // MEDCOUPLING_EXPORT void setSpaceDimension(int spaceDim); MEDCOUPLING_EXPORT void setNodeStruct(const mcIdType *nodeStrctStart, const mcIdType *nodeStrctStop); diff --git a/src/MEDCoupling/MEDCouplingMap.hxx b/src/MEDCoupling/MEDCouplingMap.hxx index 395d56e49..a1f2fa564 100644 --- a/src/MEDCoupling/MEDCouplingMap.hxx +++ b/src/MEDCoupling/MEDCouplingMap.hxx @@ -37,6 +37,7 @@ namespace MEDCoupling { public: static MCAuto< MapKeyVal > New(); + std::string getClassName() const override { return std::string("MapKeyVal"); } std::map& data() { return _m; } const std::map& data() const { return _m; } std::size_t getHeapMemorySizeWithoutChildren() const; diff --git a/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.hxx b/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.hxx index c2fcadd14..f89a28075 100644 --- a/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.hxx +++ b/src/MEDCoupling/MEDCouplingMappedExtrudedMesh.hxx @@ -40,6 +40,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingUMesh *mesh3D, const MEDCouplingUMesh *mesh2D, mcIdType cell2DId); MEDCOUPLING_EXPORT static MEDCouplingMappedExtrudedMesh *New(const MEDCouplingCMesh *mesh3D); MEDCOUPLING_EXPORT static MEDCouplingMappedExtrudedMesh *New(); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingMappedExtrudedMesh"); } MEDCOUPLING_EXPORT MEDCouplingMeshType getType() const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDCOUPLING_EXPORT std::vector getDirectChildrenWithNull() const; diff --git a/src/MEDCoupling/MEDCouplingMatrix.hxx b/src/MEDCoupling/MEDCouplingMatrix.hxx index e999bf290..3df0bb45f 100644 --- a/src/MEDCoupling/MEDCouplingMatrix.hxx +++ b/src/MEDCoupling/MEDCouplingMatrix.hxx @@ -40,6 +40,7 @@ namespace MEDCoupling public: MEDCOUPLING_EXPORT static DenseMatrix *New(mcIdType nbRows, mcIdType nbCols); MEDCOUPLING_EXPORT static DenseMatrix *New(DataArrayDouble *array, mcIdType nbRows, mcIdType nbCols); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("DenseMatrix"); } MEDCOUPLING_EXPORT DenseMatrix *deepCopy() const; MEDCOUPLING_EXPORT DenseMatrix *shallowCpy() const; MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; diff --git a/src/MEDCoupling/MEDCouplingMemArray.hxx b/src/MEDCoupling/MEDCouplingMemArray.hxx index 66323346a..e5f4a3873 100755 --- a/src/MEDCoupling/MEDCouplingMemArray.hxx +++ b/src/MEDCoupling/MEDCouplingMemArray.hxx @@ -390,6 +390,7 @@ namespace MEDCoupling static DataArrayFloat *New(); public:// abstract method overload DataArrayFloat *deepCopy() const; + std::string getClassName() const override { return std::string("DataArrayFloat"); } DataArrayFloat *buildNewEmptyInstance() const { return DataArrayFloat::New(); } DataArrayFloat *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplateFP::mySelectByTupleRanges(ranges); } DataArrayFloat *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplateFP::myKeepSelectedComponents(compoIds); } @@ -420,6 +421,7 @@ namespace MEDCoupling static DataArrayDouble *New(); double doubleValue() const; DataArrayDouble *deepCopy() const; + std::string getClassName() const override { return std::string("DataArrayDouble"); } DataArrayDouble *buildNewEmptyInstance() const { return DataArrayDouble::New(); } void checkMonotonic(bool increasing, double eps) const; bool isMonotonic(bool increasing, double eps) const; @@ -704,6 +706,7 @@ namespace MEDCoupling DataArrayInt32 *keepSelectedComponents(const std::vector& compoIds) const { return this->myKeepSelectedComponents(compoIds); } DataArrayInt32 *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return this->mySelectByTupleIdSafeSlice(bg,end2,step); } DataArrayInt32 *selectByTupleRanges(const std::vector >& ranges) const { return this->mySelectByTupleRanges(ranges); } + std::string getClassName() const override { return std::string("DataArrayInt32"); } public: DataArrayInt32Iterator *iterator(); private: @@ -724,6 +727,7 @@ namespace MEDCoupling DataArrayInt64 *keepSelectedComponents(const std::vector& compoIds) const { return DataArrayTemplate::myKeepSelectedComponents(compoIds); } DataArrayInt64 *selectByTupleIdSafeSlice(mcIdType bg, mcIdType end2, mcIdType step) const { return DataArrayTemplate::mySelectByTupleIdSafeSlice(bg,end2,step); } DataArrayInt64 *selectByTupleRanges(const std::vector >& ranges) const { return DataArrayTemplate::mySelectByTupleRanges(ranges); } + std::string getClassName() const override { return std::string("DataArrayInt64"); } public: DataArrayInt64Iterator *iterator(); private: @@ -816,6 +820,7 @@ namespace MEDCoupling void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const; std::vector toVectorOfBool() const; + std::string getClassName() const override { return std::string("DataArrayByte"); } private: ~DataArrayByte() { } DataArrayByte() { } @@ -843,6 +848,7 @@ namespace MEDCoupling void reprQuickOverview(std::ostream& stream) const; void reprQuickOverviewData(std::ostream& stream, std::size_t maxNbOfByteInRepr) const; bool isEqualIfNotWhy(const DataArrayChar& other, std::string& reason) const; + std::string getClassName() const override { return std::string("DataArrayAsciiChar"); } private: ~DataArrayAsciiChar() { } DataArrayAsciiChar() { } diff --git a/src/MEDCoupling/MEDCouplingMultiFields.hxx b/src/MEDCoupling/MEDCouplingMultiFields.hxx index 9fe1d9a13..318f53a8d 100644 --- a/src/MEDCoupling/MEDCouplingMultiFields.hxx +++ b/src/MEDCoupling/MEDCouplingMultiFields.hxx @@ -42,6 +42,7 @@ namespace MEDCoupling public: MEDCOUPLING_EXPORT static MEDCouplingMultiFields *New(const std::vector& fs); MEDCOUPLING_EXPORT static MEDCouplingMultiFields *New(); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingMultiFields"); } MEDCOUPLING_EXPORT MEDCouplingMultiFields *deepCopy() const; MEDCOUPLING_EXPORT std::string getName() const; MEDCOUPLING_EXPORT std::string getDescription() const; diff --git a/src/MEDCoupling/MEDCouplingPartDefinition.hxx b/src/MEDCoupling/MEDCouplingPartDefinition.hxx index bb32ef9fa..1a49ab09e 100644 --- a/src/MEDCoupling/MEDCouplingPartDefinition.hxx +++ b/src/MEDCoupling/MEDCouplingPartDefinition.hxx @@ -53,6 +53,7 @@ namespace MEDCoupling { public: MEDCOUPLING_EXPORT static DataArrayPartDefinition *New(DataArrayIdType *listOfIds); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("DataArrayPartDefinition"); } MEDCOUPLING_EXPORT bool isEqual(const PartDefinition *other, std::string& what) const; MEDCOUPLING_EXPORT DataArrayPartDefinition *deepCopy() const; MEDCOUPLING_EXPORT DataArrayIdType *toDAI() const; @@ -81,6 +82,7 @@ namespace MEDCoupling { public: MEDCOUPLING_EXPORT static SlicePartDefinition *New(mcIdType start, mcIdType stop, mcIdType step); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("SlicePartDefinition"); } MEDCOUPLING_EXPORT bool isEqual(const PartDefinition *other, std::string& what) const; MEDCOUPLING_EXPORT SlicePartDefinition *deepCopy() const; MEDCOUPLING_EXPORT DataArrayIdType *toDAI() const; diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.cxx b/src/MEDCoupling/MEDCouplingRefCountObject.cxx index b1af91218..b02bac41b 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.cxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.cxx @@ -88,6 +88,35 @@ bool MEDCoupling::IsCXX11Compiled() //= +std::string BigMemoryObject::debugHeapMemorySize() const +{ + std::size_t ret(getHeapMemorySizeWithoutChildren()),sum(ret); + std::ostringstream oss; + std::vector s2(getDirectChildren()); + std::set s1; + oss << "this (" << this->getClassName() << ") -> " << ret << std::endl; + while(!s2.empty()) + { + std::vector s3; + for(auto it : s2) + { + if(s1.find(it)==s1.end()) + { + ret = it->getHeapMemorySizeWithoutChildren(); sum+=ret; + oss << it->getClassName() << " -> " << ret << std::endl; + s1.insert(it); + std::vector v2(it->getDirectChildren()); + for(auto it2 : v2) + if(s1.find(it2)==s1.end()) + s3.push_back(it2); + } + } + s2=s3; + } + oss << "sum = " << sum << std::endl; + return oss.str(); +} + std::size_t BigMemoryObject::getHeapMemorySize() const { std::size_t ret(getHeapMemorySizeWithoutChildren()); diff --git a/src/MEDCoupling/MEDCouplingRefCountObject.hxx b/src/MEDCoupling/MEDCouplingRefCountObject.hxx index f9edf9ac4..22830ce3a 100644 --- a/src/MEDCoupling/MEDCouplingRefCountObject.hxx +++ b/src/MEDCoupling/MEDCouplingRefCountObject.hxx @@ -18,8 +18,7 @@ // // Author : Anthony Geay (CEA/DEN) -#ifndef __PARAMEDMEM_MEDCOUPLINGREFCOUNTOBJECT_HXX__ -#define __PARAMEDMEM_MEDCOUPLINGREFCOUNTOBJECT_HXX__ +#pragma once #include "MEDCoupling.hxx" @@ -78,8 +77,10 @@ namespace MEDCoupling std::vector getAllTheProgeny() const; bool isObjectInTheProgeny(const BigMemoryObject *obj) const; static std::size_t GetHeapMemorySizeOfObjs(const std::vector& objs); + virtual std::string getClassName() const { return "BigMemoryObject"; } virtual std::size_t getHeapMemorySizeWithoutChildren() const = 0; virtual std::vector getDirectChildrenWithNull() const = 0; + std::string debugHeapMemorySize() const; virtual ~BigMemoryObject(); private: static std::size_t GetHeapMemoryOfSet(std::set& s1, std::set& s2); @@ -130,4 +131,3 @@ namespace MEDCoupling }; } -#endif diff --git a/src/MEDCoupling/MEDCouplingSkyLineArray.hxx b/src/MEDCoupling/MEDCouplingSkyLineArray.hxx index f8afb84a1..356e28a8e 100644 --- a/src/MEDCoupling/MEDCouplingSkyLineArray.hxx +++ b/src/MEDCoupling/MEDCouplingSkyLineArray.hxx @@ -63,7 +63,7 @@ namespace MEDCoupling static MEDCouplingSkyLineArray * New( const MEDCouplingSkyLineArray & other ); static MEDCouplingSkyLineArray * BuildFromPolyhedronConn( const DataArrayIdType* c, const DataArrayIdType* cI ); - + std::string getClassName() const override { return std::string("MEDCouplingSkyLineArray"); } std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; diff --git a/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx b/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx index 3a1d7b33d..60ec6777c 100644 --- a/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx +++ b/src/MEDCoupling/MEDCouplingTimeDiscretization.hxx @@ -242,6 +242,7 @@ namespace MEDCoupling { public: MEDCouplingTimeDiscretizationInt() { } + std::string getClassName() const override { return std::string("MEDCouplingTimeDiscretizationInt"); } MEDCouplingTimeDiscretizationInt(const MEDCouplingTimeDiscretizationInt& other, bool deepCopy); static MEDCouplingTimeDiscretizationInt *New(TypeOfTimeDiscretization type); MEDCouplingTimeDiscretizationInt *performCopyOrIncrRef(bool deepCopy) const; @@ -253,6 +254,7 @@ namespace MEDCoupling { public: MEDCouplingTimeDiscretizationFloat() { } + std::string getClassName() const override { return std::string("MEDCouplingTimeDiscretizationFloat"); } MEDCouplingTimeDiscretizationFloat(const MEDCouplingTimeDiscretizationFloat& other, bool deepCopy); static MEDCouplingTimeDiscretizationFloat *New(TypeOfTimeDiscretization type); MEDCouplingTimeDiscretizationFloat *performCopyOrIncrRef(bool deepCopy) const; @@ -268,6 +270,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT MEDCouplingNoTimeLabel(); MEDCOUPLING_EXPORT MEDCouplingNoTimeLabel(const MEDCouplingTimeDiscretization& other, bool deepCopy); MEDCOUPLING_EXPORT std::string getStringRepr() const; + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingNoTimeLabel"); } MEDCOUPLING_EXPORT TypeOfTimeDiscretization getEnum() const { return DISCRETIZATION; } MEDCOUPLING_EXPORT void synchronizeTimeWith(const MEDCouplingMesh *mesh); MEDCOUPLING_EXPORT MEDCouplingTimeDiscretization *aggregate(const MEDCouplingTimeDiscretization *other) const; @@ -329,6 +332,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT MEDCouplingWithTimeStep(const MEDCouplingWithTimeStep& other, bool deepCopy); public: MEDCOUPLING_EXPORT MEDCouplingWithTimeStep(); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingWithTimeLabel"); } MEDCOUPLING_EXPORT std::string getStringRepr() const; MEDCOUPLING_EXPORT void copyTinyAttrFrom(const MEDCouplingTimeDiscretizationTemplate& other); MEDCOUPLING_EXPORT TypeOfTimeDiscretization getEnum() const { return DISCRETIZATION; } @@ -395,6 +399,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT MEDCouplingConstOnTimeInterval(const MEDCouplingConstOnTimeInterval& other, bool deepCopy); public: MEDCOUPLING_EXPORT MEDCouplingConstOnTimeInterval(); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingConstOnTimeInterval"); } MEDCOUPLING_EXPORT void copyTinyAttrFrom(const MEDCouplingTimeDiscretizationTemplate& other); MEDCOUPLING_EXPORT void getTinySerializationIntInformation(std::vector& tinyInfo) const; MEDCOUPLING_EXPORT void getTinySerializationDbleInformation(std::vector& tinyInfo) const; @@ -463,6 +468,7 @@ namespace MEDCoupling MEDCOUPLING_EXPORT MEDCouplingTwoTimeSteps(); MEDCOUPLING_EXPORT ~MEDCouplingTwoTimeSteps(); public: + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingTwoTimeSteps"); } MEDCOUPLING_EXPORT void updateTime() const; MEDCOUPLING_EXPORT void synchronizeTimeWith(const MEDCouplingMesh *mesh); MEDCOUPLING_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; diff --git a/src/MEDCoupling/MEDCouplingUMesh.hxx b/src/MEDCoupling/MEDCouplingUMesh.hxx index 35d0cc5fb..11e26a781 100644 --- a/src/MEDCoupling/MEDCouplingUMesh.hxx +++ b/src/MEDCoupling/MEDCouplingUMesh.hxx @@ -42,6 +42,7 @@ namespace MEDCoupling public: MEDCOUPLING_EXPORT static MEDCouplingUMesh *New(); MEDCOUPLING_EXPORT static MEDCouplingUMesh *New(const std::string& meshName, int meshDim); + MEDCOUPLING_EXPORT std::string getClassName() const override { return std::string("MEDCouplingUMesh"); } // Copy methods MEDCOUPLING_EXPORT MEDCouplingUMesh *deepCopy() const; MEDCOUPLING_EXPORT MEDCouplingUMesh *clone(bool recDeepCpy) const; diff --git a/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i b/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i index 7f9bdad56..16e103439 100644 --- a/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i +++ b/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i @@ -86,7 +86,9 @@ namespace MEDCoupling std::size_t getHeapMemorySize() const; std::string getHeapMemorySizeStr() const; bool isObjectInTheProgeny(const BigMemoryObject *obj) const; - virtual std::size_t getHeapMemorySizeWithoutChildren() const; + std::size_t getHeapMemorySizeWithoutChildren() const; + std::string debugHeapMemorySize() const; + std::string getClassName() const; virtual ~BigMemoryObject(); %extend { diff --git a/src/MEDLoader/MEDFileBasis.hxx b/src/MEDLoader/MEDFileBasis.hxx index 2b4f80f5c..f0e0cd19c 100644 --- a/src/MEDLoader/MEDFileBasis.hxx +++ b/src/MEDLoader/MEDFileBasis.hxx @@ -73,6 +73,7 @@ namespace MEDCoupling template static DataArrayMedInt *Copy( const INTARRAY* array ); static DataArrayMedInt *New() { return new DataArrayMedInt(); } + std::string getClassName() const override { return std::string("DataArrayMedInt"); } DataArrayMedInt *deepCopy() const { return new DataArrayMedInt(*this); } //DataArrayMedInt *buildNewEmptyInstance() const { return new DataArrayMedInt(); }//ko DataArray *buildNewEmptyInstance() const { if ( sizeof(med_int)==sizeof(int)) return DataArrayInt32::New(); return DataArrayInt64::New(); } diff --git a/src/MEDLoader/MEDFileData.hxx b/src/MEDLoader/MEDFileData.hxx index 9f7427af2..6622d8200 100644 --- a/src/MEDLoader/MEDFileData.hxx +++ b/src/MEDLoader/MEDFileData.hxx @@ -40,6 +40,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileData *New(med_idt fid); MEDLOADER_EXPORT static MEDFileData *New(); MEDLOADER_EXPORT static MEDFileData *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileData"); } MEDLOADER_EXPORT MEDFileData *deepCopy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; diff --git a/src/MEDLoader/MEDFileEquivalence.hxx b/src/MEDLoader/MEDFileEquivalence.hxx index 41dfcf839..92dea70c2 100644 --- a/src/MEDLoader/MEDFileEquivalence.hxx +++ b/src/MEDLoader/MEDFileEquivalence.hxx @@ -42,6 +42,7 @@ namespace MEDCoupling { public: static MEDFileEquivalencePair *Load(MEDFileEquivalences *father, med_idt fid, const std::string& name, const std::string &desc); + std::string getClassName() const override { return std::string("MEDFileEquivalencePair"); } void writeLL(med_idt fid) const; const MEDFileEquivalences *getFather() const { return _father; } MEDFileEquivalences *getFather() { return _father; } @@ -89,6 +90,7 @@ namespace MEDCoupling bool isEqual(const MEDFileEquivalences *other, std::string& what) const; void getRepr(std::ostream& oss) const; public: + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileEquivalences"); } MEDLOADER_EXPORT MEDFileEquivalencePair *getEquivalence(int i); MEDLOADER_EXPORT MEDFileEquivalencePair *getEquivalenceWithName(const std::string& name); MEDLOADER_EXPORT int size() const; @@ -128,6 +130,7 @@ namespace MEDCoupling { public: MEDFileEquivalenceData(MEDFileEquivalencePair *owner, DataArrayInt *data); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileEquivalenceData"); } MEDLOADER_EXPORT void setArray(DataArrayInt *data); MEDLOADER_EXPORT const DataArrayInt *getArray() const { return _data; } MEDLOADER_EXPORT DataArrayInt *getArray() { return _data; } @@ -145,6 +148,7 @@ namespace MEDCoupling { public: MEDFileEquivalenceCellType(MEDFileEquivalencePair *owner, INTERP_KERNEL::NormalizedCellType type, DataArrayInt *data):MEDFileEquivalenceData(owner,data),_type(type) { } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileEquivalenceCellType"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; INTERP_KERNEL::NormalizedCellType getType() const { return _type; } MEDFileEquivalenceCellType *deepCopy(MEDFileEquivalencePair *owner) const; @@ -163,6 +167,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileEquivalenceCell"); } static MEDFileEquivalenceCell *Load(med_idt fid, MEDFileEquivalencePair *owner); void writeLL(med_idt fid) const; MEDFileEquivalenceCell *deepCopy(MEDFileEquivalencePair *owner) const; @@ -190,6 +195,7 @@ namespace MEDCoupling { public: MEDFileEquivalenceNode(MEDFileEquivalencePair *owner, DataArrayInt *data):MEDFileEquivalenceData(owner,data) { } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileEquivalenceNode"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; void writeLL(med_idt fid) const; MEDFileEquivalenceNode *deepCopy(MEDFileEquivalencePair *owner) const; diff --git a/src/MEDLoader/MEDFileField.hxx b/src/MEDLoader/MEDFileField.hxx index 7897ccc81..970c88ed9 100644 --- a/src/MEDLoader/MEDFileField.hxx +++ b/src/MEDLoader/MEDFileField.hxx @@ -77,6 +77,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(const std::string& fileName, const MEDFileStructureElements *se, bool loadAll=true); MEDLOADER_EXPORT static MEDFileFields *NewWithDynGT(med_idt fid, const MEDFileStructureElements *se, bool loadAll=true); MEDLOADER_EXPORT static MEDFileFields *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFields"); } MEDLOADER_EXPORT static MEDFileFields *LoadPartOf(const std::string& fileName, bool loadAll=true, const MEDFileMeshes *ms=0); MEDLOADER_EXPORT static MEDFileFields *LoadSpecificEntities(const std::string& fileName, const std::vector< std::pair >& entities, bool loadAll=true); MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; diff --git a/src/MEDLoader/MEDFileField1TS.hxx b/src/MEDLoader/MEDFileField1TS.hxx index 7d7e874d0..924ef6ee3 100644 --- a/src/MEDLoader/MEDFileField1TS.hxx +++ b/src/MEDLoader/MEDFileField1TS.hxx @@ -41,6 +41,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA(); MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileAnyTypeField1TSWithoutSDA"); } MEDLOADER_EXPORT int getIteration() const { return _iteration; } MEDLOADER_EXPORT int getOrder() const { return _order; } MEDLOADER_EXPORT double getTime(int& iteration, int& order) const { iteration=_iteration; order=_order; return _dt; } @@ -172,6 +173,7 @@ namespace MEDCoupling { public: MEDLOADER_EXPORT const char *getTypeStr() const; + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileField1TSWithoutSDA"); } MEDLOADER_EXPORT DataArray *getUndergroundDataArrayExt(std::vector< std::pair,std::pair > >& entries) const; MEDLOADER_EXPORT std::vector< std::vector > getFieldSplitedByType2(const std::string& mname, std::vector& types, std::vector< std::vector >& typesF, std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const; MEDLOADER_EXPORT static void CheckMeshDimRel(int meshDimRelToMax); @@ -204,6 +206,7 @@ namespace MEDCoupling { public: MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA(); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntField1TSWithoutSDA"); } MEDLOADER_EXPORT static MEDFileIntField1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos); MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *deepCopy() const; MEDLOADER_EXPORT MEDFileIntField1TSWithoutSDA *shallowCpy() const; @@ -223,6 +226,7 @@ namespace MEDCoupling { public: MEDLOADER_EXPORT MEDFileFloatField1TSWithoutSDA(); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFloatField1TSWithoutSDA"); } MEDLOADER_EXPORT static MEDFileFloatField1TSWithoutSDA *New(const std::string& fieldName, const std::string& meshName, int csit, int iteration, int order, const std::vector& infos); MEDLOADER_EXPORT MEDFileFloatField1TSWithoutSDA *deepCopy() const; MEDLOADER_EXPORT MEDFileFloatField1TSWithoutSDA *shallowCpy() const; @@ -246,6 +250,7 @@ namespace MEDCoupling MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0); MEDLOADER_EXPORT MEDFileAnyTypeField1TS(med_idt fid, const std::string& fieldName, int iteration, int order, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities=0); MEDLOADER_EXPORT MEDFileAnyTypeField1TS(const MEDFileAnyTypeField1TSWithoutSDA& other, bool shallowCopyOfContent); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileAnyTypeField1TS"); } MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c); MEDLOADER_EXPORT static MEDFileAnyTypeField1TS *BuildNewInstanceFromContent(MEDFileAnyTypeField1TSWithoutSDA *c, med_idt fid); MEDLOADER_EXPORT static MEDFileAnyTypeField1TSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities); @@ -392,6 +397,7 @@ namespace MEDCoupling MEDLOADER_EXPORT MEDFileField1TS *shallowCpy() const; MEDLOADER_EXPORT std::vector< std::vector > getFieldSplitedByType2(const std::string& mname, std::vector& types, std::vector< std::vector >& typesF, std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const; + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileField1TS"); } public: private: med_field_type getMEDFileFieldType() const { return MED_FLOAT64; } @@ -423,6 +429,7 @@ namespace MEDCoupling friend class MEDFileTemplateField1TS; public: MEDLOADER_EXPORT MEDFileIntField1TS *shallowCpy() const { return new MEDFileIntField1TS(*this); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntField1TS"); } public: MEDLOADER_EXPORT static MCAuto ConvertFieldIntToFieldDouble(const MEDCouplingFieldInt *f); private: @@ -448,6 +455,7 @@ namespace MEDCoupling private: med_field_type getMEDFileFieldType() const { return MED_FLOAT32; } MEDLOADER_EXPORT MEDFileFloatField1TS *shallowCpy() const { return new MEDFileFloatField1TS(*this); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFloatField1TS"); } private: ~MEDFileFloatField1TS() { } MEDFileFloatField1TS() { } diff --git a/src/MEDLoader/MEDFileFieldGlobs.hxx b/src/MEDLoader/MEDFileFieldGlobs.hxx index 5744392ee..929380294 100644 --- a/src/MEDLoader/MEDFileFieldGlobs.hxx +++ b/src/MEDLoader/MEDFileFieldGlobs.hxx @@ -41,6 +41,7 @@ namespace MEDCoupling public: static MEDFileFieldGlobs *New(med_idt fid); static MEDFileFieldGlobs *New(); + std::string getClassName() const override { return std::string("MEDFileFieldGlobs"); } std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; MEDFileFieldGlobs *deepCopy() const; diff --git a/src/MEDLoader/MEDFileFieldInternal.hxx b/src/MEDLoader/MEDFileFieldInternal.hxx index bb2e318df..1ad0b35bb 100644 --- a/src/MEDLoader/MEDFileFieldInternal.hxx +++ b/src/MEDLoader/MEDFileFieldInternal.hxx @@ -85,6 +85,7 @@ namespace MEDCoupling MEDLOADER_EXPORT void simpleRepr(std::ostream& oss) const; MEDLOADER_EXPORT std::string getName() const { return _name; } MEDLOADER_EXPORT void setName(const std::string& name); + std::string getClassName() const override { return std::string("MEDFileFieldLoc"); } static MEDFileFieldLoc *New(med_idt fid, const std::string& locName); static MEDFileFieldLoc *New(med_idt fid, int i, const MEDFileEntities *entities); static MEDFileFieldLoc *New(const std::string& locName, INTERP_KERNEL::NormalizedCellType geoType, const std::vector& refCoo, const std::vector& gsCoo, const std::vector& w); @@ -135,6 +136,7 @@ namespace MEDCoupling static MEDFileFieldPerMeshPerTypePerDisc *NewOnRead(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, int profileIt, const PartDefinition *pd); static MEDFileFieldPerMeshPerTypePerDisc *New(MEDFileFieldPerMeshPerTypeCommon *fath, TypeOfField type, mcIdType locId); static MEDFileFieldPerMeshPerTypePerDisc *New(const MEDFileFieldPerMeshPerTypePerDisc& other); + std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerTypePerDisc"); } std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; MEDFileFieldPerMeshPerTypePerDisc *deepCopy(MEDFileFieldPerMeshPerTypeCommon *father) const; @@ -220,6 +222,7 @@ namespace MEDCoupling class MEDFileFieldPerMeshPerTypeCommon : public RefCountObject, public MEDFileWritable { public: + std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerTypeCommon"); } std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; void assignFieldNoProfile(mcIdType& start, mcIdType offset, mcIdType nbOfCells, const MEDCouplingFieldTemplate *field, const DataArray *arr, MEDFileFieldGlobsReal& glob, const MEDFileFieldNameScope& nasc); @@ -286,6 +289,7 @@ namespace MEDCoupling class MEDFileFieldPerMeshPerType : public MEDFileFieldPerMeshPerTypeCommon { public: + std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerType"); } static MEDFileFieldPerMeshPerType *New(MEDFileFieldPerMesh *fath, INTERP_KERNEL::NormalizedCellType geoType); static MEDFileFieldPerMeshPerType *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, TypeOfField type, INTERP_KERNEL::NormalizedCellType geoType, const MEDFileFieldNameScope& nasc, const PartDefinition *pd); static MCAuto Aggregate(mcIdType &start, const std::vector< std::pair >& pms, const std::vector< std::vector< std::pair > >& dts, INTERP_KERNEL::NormalizedCellType gt, MEDFileFieldPerMesh *father, std::vector > >& extractInfo); @@ -308,6 +312,7 @@ namespace MEDCoupling { public: static MEDFileFieldPerMeshPerTypeDyn *NewOnRead(med_idt fid, MEDFileFieldPerMesh *fath, const MEDFileEntities *entities, int idGT, const MEDFileFieldNameScope& nasc); + std::string getClassName() const override { return std::string("MEDFileFieldPerMeshPerTypeDyn"); } int getDynGT() const; std::string getModelName() const; public: @@ -333,6 +338,7 @@ namespace MEDCoupling public: 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, const MEDFileMesh *mm, const MEDFileEntities *entities); + std::string getClassName() const override { return std::string("MEDFileFieldPerMesh"); } std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; MEDFileFieldPerMesh *deepCopy(MEDFileAnyTypeField1TSWithoutSDA *father) const; diff --git a/src/MEDLoader/MEDFileFieldMultiTS.hxx b/src/MEDLoader/MEDFileFieldMultiTS.hxx index dd7b082aa..25fed601a 100644 --- a/src/MEDLoader/MEDFileFieldMultiTS.hxx +++ b/src/MEDLoader/MEDFileFieldMultiTS.hxx @@ -44,6 +44,7 @@ namespace MEDCoupling MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities); MEDFileAnyTypeFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities); public: + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileAnyTypeFieldMultiTSWithoutSDA"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT virtual MEDFileAnyTypeFieldMultiTSWithoutSDA *deepCopy() const; @@ -128,6 +129,7 @@ namespace MEDCoupling MEDLOADER_EXPORT const char *getTypeStr() const; MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *createNew() const; MEDLOADER_EXPORT MEDFileAnyTypeField1TSWithoutSDA *createNew1TSWithoutSDAEmptyInstance() const; + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileTemplateFieldMultiTSWithoutSDA"); } protected: MEDFileTemplateFieldMultiTSWithoutSDA() { } MEDFileTemplateFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileAnyTypeFieldMultiTSWithoutSDA(fieldName,meshName) { } @@ -145,6 +147,7 @@ namespace MEDCoupling MEDLOADER_EXPORT std::vector< std::vector > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector& types, std::vector< std::vector >& typesF, std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const; MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA *convertToInt() const; MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const { return new MEDFileFieldMultiTSWithoutSDA(*this); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFieldMultiTSWithoutSDA"); } protected: MEDFileFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileTemplateFieldMultiTSWithoutSDA(fieldName,meshName) { } MEDFileFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileTemplateFieldMultiTSWithoutSDA(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { } @@ -171,6 +174,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA(fid,fieldId,loadAll,ms,entities) { } MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const { return new MEDFileIntFieldMultiTSWithoutSDA(*this); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntFieldMultiTSWithoutSDA"); } protected: MEDFileIntFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileNDTemplateFieldMultiTSWithoutSDA(fieldName,meshName) { } MEDFileIntFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { } @@ -185,6 +189,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT MEDFileFloatFieldMultiTSWithoutSDA(med_idt fid, int fieldId, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA(fid,fieldId,loadAll,ms,entities) { } MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTSWithoutSDA *shallowCpy() const { return new MEDFileFloatFieldMultiTSWithoutSDA(*this); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFloatFieldMultiTSWithoutSDA"); } protected: MEDFileFloatFieldMultiTSWithoutSDA(const std::string& fieldName, const std::string& meshName):MEDFileNDTemplateFieldMultiTSWithoutSDA(fieldName,meshName) { } MEDFileFloatFieldMultiTSWithoutSDA(med_idt fid, const std::string& fieldName, const std::string& meshName, med_field_type fieldTyp, const std::vector& infos, int nbOfStep, const std::string& dtunit, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities):MEDFileNDTemplateFieldMultiTSWithoutSDA(fid,fieldName,meshName,fieldTyp,infos,nbOfStep,dtunit,loadAll,ms,entities) { } @@ -208,6 +213,7 @@ namespace MEDCoupling static MEDFileAnyTypeFieldMultiTS *BuildNewInstanceFromContent(MEDFileAnyTypeFieldMultiTSWithoutSDA *c, med_idt fid); static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, bool loadAll, const MEDFileMeshes *ms); static MEDFileAnyTypeFieldMultiTSWithoutSDA *BuildContentFrom(med_idt fid, const std::string& fieldName, bool loadAll, const MEDFileMeshes *ms, const MEDFileEntities *entities); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileAnyTypeFieldMultiTS"); } public: MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(const std::string& fileName, bool loadAll=true); MEDLOADER_EXPORT static MEDFileAnyTypeFieldMultiTS *New(med_idt fid, bool loadAll=true); @@ -342,6 +348,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const; MEDLOADER_EXPORT MEDFileIntFieldMultiTS *convertToInt(bool isDeepCpyGlobs=true) const; + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFieldMultiTS"); } // MEDLOADER_EXPORT std::vector< std::vector > getFieldSplitedByType2(int iteration, int order, const std::string& mname, std::vector& types, std::vector< std::vector >& typesF, std::vector< std::vector >& pfls, std::vector< std::vector >& locs) const; MEDLOADER_EXPORT MEDFileFieldMultiTS *buildNewEmpty() const { return buildNewEmptyImpl(); } @@ -376,6 +383,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const { return new MEDFileIntFieldMultiTS(*this); } MEDLOADER_EXPORT MEDFileIntFieldMultiTS *buildNewEmpty() const { return buildNewEmptyImpl(); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileIntFieldMultiTS"); } private: ~MEDFileIntFieldMultiTS() { } MEDFileIntFieldMultiTS() { } @@ -393,6 +401,7 @@ namespace MEDCoupling public: MEDLOADER_EXPORT MEDFileAnyTypeFieldMultiTS *shallowCpy() const { return new MEDFileFloatFieldMultiTS(*this); } MEDLOADER_EXPORT MEDFileFloatFieldMultiTS *buildNewEmpty() const { return buildNewEmptyImpl(); } + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFloatFieldMultiTS"); } private: ~MEDFileFloatFieldMultiTS() { } MEDFileFloatFieldMultiTS() { } diff --git a/src/MEDLoader/MEDFileFieldOverView.hxx b/src/MEDLoader/MEDFileFieldOverView.hxx index f6a382b42..abb0f06d6 100644 --- a/src/MEDLoader/MEDFileFieldOverView.hxx +++ b/src/MEDLoader/MEDFileFieldOverView.hxx @@ -50,6 +50,7 @@ namespace MEDCoupling { public: MEDLOADER_EXPORT static MEDFileMeshStruct *New(const MEDFileMesh *mesh); + std::string getClassName() const override { return std::string("MEDFileMeshStruct"); } std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; const MEDFileMesh *getTheMesh() const { return _mesh; } @@ -77,6 +78,7 @@ namespace MEDCoupling public: std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; + std::string getClassName() const override { return std::string("MEDMeshMultiLev"); } public: static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); static MEDMeshMultiLev *New(const MEDFileMesh *m, const std::vector& levs); @@ -133,6 +135,7 @@ namespace MEDCoupling static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector& levs); static MEDUMeshMultiLev *New(const MEDFileUMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); void selectPartOfNodes(const DataArrayIdType *pflNodes); + std::string getClassName() const override { return std::string("MEDUMeshMultiLev"); } MEDMeshMultiLev *prepare() const; MEDUMeshMultiLev(const MEDStructuredMeshMultiLev& other, const MCAuto& part); MEDLOADER_EXPORT bool buildVTUArrays(DataArrayDouble *& coords, DataArrayByte *&types, DataArrayIdType *&cellLocations, DataArrayIdType *& cells, DataArrayIdType *&faceLocations, DataArrayIdType *&faces) const; @@ -155,6 +158,7 @@ namespace MEDCoupling public: void selectPartOfNodes(const DataArrayIdType *pflNodes); virtual std::vector getNodeGridStructure() const = 0; + std::string getClassName() const override { return std::string("MEDStructuredMeshMultiLev"); } protected: MEDStructuredMeshMultiLev(const MEDStructuredMeshMultiLev& other); MEDStructuredMeshMultiLev(const MEDFileStructuredMesh *m, const std::vector& lev); @@ -177,6 +181,7 @@ namespace MEDCoupling static MEDCMeshMultiLev *New(const MEDFileCMesh *m, const std::vector& levs); static MEDCMeshMultiLev *New(const MEDFileCMesh *m, const std::vector& gts, const std::vector& pfls, const std::vector& nbEntities); std::vector getNodeGridStructure() const; + std::string getClassName() const override { return std::string("MEDCMeshMultiLev"); } MEDMeshMultiLev *prepare() const; MEDLOADER_EXPORT std::vector< DataArrayDouble * > buildVTUArrays(bool& isInternal) const; private: @@ -192,6 +197,7 @@ namespace MEDCoupling public: static MEDCurveLinearMeshMultiLev *New(const MEDFileCurveLinearMesh *m, const std::vector& levs); static MEDCurveLinearMeshMultiLev *New(const MEDFileCurveLinearMesh *m, const std::vector& gts, const std::vector& pfls , const std::vector& nbEntities); + std::string getClassName() const override { return std::string("MEDCurveLinearMeshMultiLev"); } std::vector getNodeGridStructure() const; MEDMeshMultiLev *prepare() const; MEDLOADER_EXPORT void buildVTUArrays(DataArrayDouble *&coords, std::vector& nodeStrct, bool& isInternal) const; @@ -209,6 +215,7 @@ namespace MEDCoupling public: MEDFileField1TSStructItem2(); MEDFileField1TSStructItem2(INTERP_KERNEL::NormalizedCellType a, const std::pair& b, const std::string& pfl, const std::string& loc); + std::string getClassName() const override { return std::string("MEDFileField1TSStructItem2"); } void checkWithMeshStructForCells(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); void checkWithMeshStructForGaussNE(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); void checkWithMeshStructForGaussPT(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); @@ -246,6 +253,7 @@ namespace MEDCoupling MEDFileField1TSStructItem(TypeOfField a, const std::vector< MEDFileField1TSStructItem2 >& b); void checkWithMeshStruct(const MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); bool operator==(const MEDFileField1TSStructItem& other) const; + std::string getClassName() const override { return std::string("MEDFileField1TSStructItem"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; bool isEntityCell() const; @@ -274,6 +282,7 @@ namespace MEDCoupling static MEDFileField1TSStruct *New(const MEDFileAnyTypeField1TS *ref, MEDFileMeshStruct *mst); void checkWithMeshStruct(MEDFileMeshStruct *mst, const MEDFileFieldGlobsReal *globs); std::size_t getHeapMemorySizeWithoutChildren() const; + std::string getClassName() const override { return std::string("MEDFileField1TSStruct"); } std::vector getDirectChildrenWithNull() const; bool isEqualConsideringThePast(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *mst) const; bool isSupportSameAs(const MEDFileAnyTypeField1TS *other, const MEDFileMeshStruct *meshSt); @@ -293,6 +302,7 @@ namespace MEDCoupling { public: MEDLOADER_EXPORT static MEDFileFastCellSupportComparator *New(const MEDFileMeshStruct *m, const MEDFileAnyTypeFieldMultiTS *ref); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileFastCellSupportComparator"); } MEDLOADER_EXPORT MEDMeshMultiLev *buildFromScratchDataSetSupport(int timeStepId, const MEDFileFieldGlobsReal *globs) const; MEDLOADER_EXPORT bool isDataSetSupportEqualToThePreviousOne(int timeStepId, const MEDFileFieldGlobsReal *globs) const; MEDLOADER_EXPORT int getNumberOfTS() const; diff --git a/src/MEDLoader/MEDFileJoint.hxx b/src/MEDLoader/MEDFileJoint.hxx index 567d97abf..e1100e647 100644 --- a/src/MEDLoader/MEDFileJoint.hxx +++ b/src/MEDLoader/MEDFileJoint.hxx @@ -43,6 +43,7 @@ public: MEDLOADER_EXPORT static MEDFileJointCorrespondence *New(DataArrayIdType* correspondence, // cells INTERP_KERNEL::NormalizedCellType loc_geo_type, INTERP_KERNEL::NormalizedCellType rem_geo_type); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileJointCorrespondence"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileJointCorrespondence *deepCopy() const; @@ -82,6 +83,7 @@ public: MEDLOADER_EXPORT static MEDFileJointOneStep *New(int dt=-1, int it=-1); MEDLOADER_EXPORT static MEDFileJointOneStep *New(const std::string& fileName, const std::string& mName, const std::string& jointName, int number=1); MEDLOADER_EXPORT static MEDFileJointOneStep *New(med_idt fid, const std::string& mName, const std::string& jointName, int number=1); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileJointOneStep"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileJointOneStep *deepCopy() const; @@ -121,6 +123,7 @@ public: MEDLOADER_EXPORT static MEDFileJoint *New(const std::string& fileName, const std::string& mName, int num); MEDLOADER_EXPORT static MEDFileJoint *New(med_idt fid, const std::string& mName, int num); MEDLOADER_EXPORT static MEDFileJoint *New(const std::string& jointName, const std::string& locMeshName, const std::string& remoteMeshName, int remoteMeshNum ); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileJoint"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileJoint *deepCopy() const; @@ -165,6 +168,7 @@ public: MEDLOADER_EXPORT static MEDFileJoints *New(); MEDLOADER_EXPORT static MEDFileJoints *New(const std::string& fileName, const std::string& meshName); MEDLOADER_EXPORT static MEDFileJoints *New(med_idt fid, const std::string& meshName); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileJoints"); } MEDLOADER_EXPORT MEDFileJoints *deepCopy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; diff --git a/src/MEDLoader/MEDFileMesh.hxx b/src/MEDLoader/MEDFileMesh.hxx index aadb0fcc3..38a2d6e68 100644 --- a/src/MEDLoader/MEDFileMesh.hxx +++ b/src/MEDLoader/MEDFileMesh.hxx @@ -265,6 +265,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileUMesh *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileUMesh *New(const MEDCouplingMappedExtrudedMesh *mem); MEDLOADER_EXPORT static MEDFileUMesh *New(); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileUMesh"); } MEDLOADER_EXPORT static MEDFileUMesh *LoadPartOf(const std::string& fileName, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileUMesh *LoadPartOf(med_idt fid, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static const char *GetSpeStr4ExtMesh() { return SPE_FAM_STR_EXTRUDED_MESH; } @@ -483,6 +484,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileCMesh *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileCMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileCMesh *New(med_idt fid, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileCMesh"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const; @@ -519,6 +521,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(const std::string& fileName, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); MEDLOADER_EXPORT static MEDFileCurveLinearMesh *New(med_idt fid, const std::string& mName, int dt=-1, int it=-1, MEDFileMeshReadSelector *mrs=0); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileCurveLinearMesh"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileMesh *createNewEmpty() const; @@ -552,6 +555,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName); MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(med_idt fid, const std::string& mName); MEDLOADER_EXPORT static MEDFileMeshMultiTS *New(const std::string& fileName, const std::string& mName); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileMeshMultiTS"); } MEDLOADER_EXPORT MEDFileMeshMultiTS *deepCopy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; @@ -585,6 +589,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileMeshes *New(med_idt fid); MEDLOADER_EXPORT static MEDFileMeshes *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileMeshes *New(const std::string& fileName); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileMeshes"); } MEDLOADER_EXPORT MEDFileMeshes *deepCopy() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; diff --git a/src/MEDLoader/MEDFileMeshElt.hxx b/src/MEDLoader/MEDFileMeshElt.hxx index b0417ae67..0aeba4211 100644 --- a/src/MEDLoader/MEDFileMeshElt.hxx +++ b/src/MEDLoader/MEDFileMeshElt.hxx @@ -39,6 +39,7 @@ namespace MEDCoupling { public: static MEDFileUMeshPerTypeCommon *New(); + std::string getClassName() const override { return std::string("MEDFileUMeshPerTypeCommon"); } void loadCommonPart(med_idt fid, const char *mName, int dt, int it, mcIdType curNbOfElem, med_geometry_type geoElt, med_entity_type entity, MEDFileMeshReadSelector *mrs); std::size_t getHeapMemorySizeWithoutChildren() const; @@ -57,6 +58,7 @@ namespace MEDCoupling public: 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 MEDFileUMeshPerType *NewPart(med_idt fid, const char *mName, int dt, int it, int mdim, INTERP_KERNEL::NormalizedCellType geoElt2, mcIdType strt, mcIdType stp, mcIdType step, MEDFileMeshReadSelector *mrs); + std::string getClassName() const override { return std::string("MEDFileUMeshPerType"); } 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 getDirectChildrenWithNull() const; diff --git a/src/MEDLoader/MEDFileMeshLL.hxx b/src/MEDLoader/MEDFileMeshLL.hxx index 21cb9c494..e23ce5e9e 100644 --- a/src/MEDLoader/MEDFileMeshLL.hxx +++ b/src/MEDLoader/MEDFileMeshLL.hxx @@ -117,6 +117,7 @@ namespace MEDCoupling { public: MEDFileUMeshL2(); + std::string getClassName() const override { return std::string("MEDFileUMeshL2"); } std::vector loadCommonPart(med_idt fid, const MeshOrStructMeshCls *mId, const std::string& mName, int dt, int it, int& Mdim); void loadAll(med_idt fid, const MeshOrStructMeshCls *mId, const std::string& mName, int dt, int it, MEDFileMeshReadSelector *mrs); void loadPart(med_idt fid, const MeshOrStructMeshCls *mId, const std::string& mName, const std::vector& types, const std::vector& slicPerTyp, int dt, int it, MEDFileMeshReadSelector *mrs); @@ -155,6 +156,7 @@ namespace MEDCoupling { public: MEDFileCMeshL2(); + std::string getClassName() const override { return std::string("MEDFileCMeshL2"); } void loadAll(med_idt fid, const MeshOrStructMeshCls *mId, const std::string& mName, int dt, int it); MEDCouplingCMesh *getMesh() { return _cmesh; } MEDCoupling::MEDCouplingAxisType getAxisType() const { return _ax_type; } @@ -169,6 +171,7 @@ namespace MEDCoupling { public: MEDFileCLMeshL2(); + std::string getClassName() const override { return std::string("MEDFileCLMeshL2"); } void loadAll(med_idt fid, const MeshOrStructMeshCls *mId, const std::string& mName, int dt, int it); MEDCouplingCurveLinearMesh *getMesh() { return _clmesh; } private: @@ -182,6 +185,7 @@ namespace MEDCoupling { public: MEDFileUMeshPermCompute(const MEDFileUMeshSplitL1* st); + std::string getClassName() const override { return std::string("MEDFileUMeshPermCompute"); } operator MEDCouplingUMesh *() const; void operator=(MEDCouplingUMesh *m); void updateTime() const; @@ -198,6 +202,7 @@ namespace MEDCoupling { public: MEDFileUMeshAggregateCompute(); + std::string getClassName() const override { return std::string("MEDFileUMeshAggregateCompute"); } void setName(const std::string& name); void assignParts(const std::vector< const MEDCoupling1GTUMesh * >& mParts); void assignDefParts(const std::vector& partDefs); @@ -251,6 +256,7 @@ namespace MEDCoupling MEDFileUMeshSplitL1(MEDCoupling1GTUMesh *m); MEDFileUMeshSplitL1(MEDCouplingUMesh *m); MEDFileUMeshSplitL1(MEDCouplingUMesh *m, bool newOrOld); + std::string getClassName() const override { return std::string("MEDFileUMeshSplitL1"); } void setName(const std::string& name); std::size_t getHeapMemorySizeWithoutChildren() const; std::vector getDirectChildrenWithNull() const; @@ -330,6 +336,7 @@ namespace MEDCoupling { public: static MEDFileEltStruct4Mesh *New(med_idt fid, const std::string& mName, int dt, int it, int iterOnStEltOfMesh, MEDFileMeshReadSelector *mrs); + std::string getClassName() const override { return std::string("MEDFileEltStruct4Mesh"); } std::string getGeoTypeName() const { return _geo_type_name; } MCAuto getConn() const { return _conn; } MCAuto getMeshDef() const { return _common; } diff --git a/src/MEDLoader/MEDFileMeshSupport.hxx b/src/MEDLoader/MEDFileMeshSupport.hxx index 00634fdb2..3f8b80d01 100644 --- a/src/MEDLoader/MEDFileMeshSupport.hxx +++ b/src/MEDLoader/MEDFileMeshSupport.hxx @@ -35,6 +35,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileMeshSupports *New(const std::string& fileName); MEDLOADER_EXPORT static MEDFileMeshSupports *New(med_idt fid); MEDLOADER_EXPORT static MEDFileMeshSupports *New(); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileMeshSupports"); } public: MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; diff --git a/src/MEDLoader/MEDFileParameter.hxx b/src/MEDLoader/MEDFileParameter.hxx index 322602f34..0d5423309 100644 --- a/src/MEDLoader/MEDFileParameter.hxx +++ b/src/MEDLoader/MEDFileParameter.hxx @@ -58,6 +58,7 @@ namespace MEDCoupling { public: MEDLOADER_EXPORT static MEDFileParameterDouble1TSWTI *New(int iteration, int order, double time); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileParameterDouble1TSWTI"); } MEDLOADER_EXPORT MEDFileParameter1TS *deepCopy() const; MEDLOADER_EXPORT void setValue(double val) { _arr=val; } MEDLOADER_EXPORT double getValue() const { return _arr; } @@ -102,6 +103,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const std::string& fileName); MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName); MEDLOADER_EXPORT static MEDFileParameterDouble1TS *New(const std::string& fileName, const std::string& paramName, int dt, int it); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileParameterDouble1TS"); } MEDLOADER_EXPORT virtual MEDFileParameter1TS *deepCopy() const; MEDLOADER_EXPORT virtual bool isEqual(const MEDFileParameter1TS *other, double eps, std::string& what) const; MEDLOADER_EXPORT virtual std::string simpleRepr() const; @@ -125,6 +127,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileParameterMultiTS *New(med_idt fid); MEDLOADER_EXPORT static MEDFileParameterMultiTS *New(const std::string& fileName, const std::string& paramName); MEDLOADER_EXPORT static MEDFileParameterMultiTS *New(med_idt fid, const std::string& paramName); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileParameterMultiTS"); } MEDLOADER_EXPORT std::string getName() const { return _name; } MEDLOADER_EXPORT void setName(const std::string& name) { _name=name; } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; @@ -161,6 +164,7 @@ namespace MEDCoupling MEDLOADER_EXPORT static MEDFileParameters *New(med_idt fid); MEDLOADER_EXPORT static MEDFileParameters *New(DataArrayByte *db) { return BuildFromMemoryChunk(db); } MEDLOADER_EXPORT static MEDFileParameters *New(const std::string& fileName); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileParameters"); } MEDLOADER_EXPORT std::size_t getHeapMemorySizeWithoutChildren() const; MEDLOADER_EXPORT std::vector getDirectChildrenWithNull() const; MEDLOADER_EXPORT MEDFileParameters *deepCopy() const; diff --git a/src/MEDLoader/MEDFileStructureElement.hxx b/src/MEDLoader/MEDFileStructureElement.hxx index b31802b36..d4b5b6d7b 100644 --- a/src/MEDLoader/MEDFileStructureElement.hxx +++ b/src/MEDLoader/MEDFileStructureElement.hxx @@ -52,6 +52,7 @@ class MEDFileSEConstAtt : public RefCountObject, public MEDFileWritableStandAlon public: static MEDFileSEConstAtt *New(med_idt fid, MEDFileStructureElement *father, int idCstAtt, const MEDFileUMesh *mesh); public: + std::string getClassName() const override { return std::string("MEDFileSEConstAtt"); } std::vector getDirectChildrenWithNull() const; std::size_t getHeapMemorySizeWithoutChildren() const; void writeLL(med_idt fid) const; @@ -70,6 +71,7 @@ class MEDFileSEConstAtt : public RefCountObject, public MEDFileWritableStandAlon public: static MEDFileSEVarAtt *New(med_idt fid, MEDFileStructureElement *father, int idVarAtt); public: + std::string getClassName() const override { return std::string("MEDFileSEVarAtt"); } std::vector getDirectChildrenWithNull() const; std::size_t getHeapMemorySizeWithoutChildren() const; void writeLL(med_idt fid) const; @@ -92,6 +94,7 @@ class MEDFileSEConstAtt : public RefCountObject, public MEDFileWritableStandAlon MEDLOADER_EXPORT std::string getMeshName() const; MEDLOADER_EXPORT std::vector getVarAtts() const; MEDLOADER_EXPORT const MEDFileSEVarAtt *getVarAtt(const std::string& varName) const; + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileStructureElement"); } public: std::vector getDirectChildrenWithNull() const; std::size_t getHeapMemorySizeWithoutChildren() const; @@ -118,6 +121,7 @@ class MEDFileSEConstAtt : public RefCountObject, public MEDFileWritableStandAlon MEDLOADER_EXPORT static MEDFileStructureElements *New(const std::string& fileName, const MEDFileMeshSupports *ms); MEDLOADER_EXPORT static MEDFileStructureElements *New(med_idt fid, const MEDFileMeshSupports *ms); MEDLOADER_EXPORT static MEDFileStructureElements *New(); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("MEDFileStructureElements"); } MEDLOADER_EXPORT int getNumberOf() const; MEDLOADER_EXPORT std::vector getDynGTAvail() const; MEDLOADER_EXPORT const MEDFileStructureElement *getWithGT(int idGT) const; diff --git a/src/MEDLoader/SauvMedConvertor.hxx b/src/MEDLoader/SauvMedConvertor.hxx index 9fc216225..49e12ef26 100644 --- a/src/MEDLoader/SauvMedConvertor.hxx +++ b/src/MEDLoader/SauvMedConvertor.hxx @@ -326,7 +326,7 @@ namespace SauvUtilities virtual double getDouble() const; virtual std::string getName() const; int lineNb() const { return _lineNb; } - + std::string getClassName() const override { return std::string("ASCIIReader"); } private: bool getLine(char* & line); @@ -364,7 +364,7 @@ namespace SauvUtilities virtual float getFloat() const; virtual double getDouble() const; virtual std::string getName() const; - + std::string getClassName() const override { return std::string("XDRReader"); } private: void init( int nbToRead, int width = 0 ); diff --git a/src/MEDLoader/SauvReader.hxx b/src/MEDLoader/SauvReader.hxx index a9d28915e..33e4bb11b 100644 --- a/src/MEDLoader/SauvReader.hxx +++ b/src/MEDLoader/SauvReader.hxx @@ -49,6 +49,7 @@ class SauvReader : public MEDCoupling::RefCountObject MEDLOADER_EXPORT static SauvReader* New(const std::string& fileName); MEDLOADER_EXPORT MEDCoupling::MEDFileData * loadInMEDFileDS(); MEDLOADER_EXPORT ~SauvReader(); + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("SauvReader"); } private: std::size_t getHeapMemorySizeWithoutChildren() const; diff --git a/src/MEDLoader/SauvWriter.hxx b/src/MEDLoader/SauvWriter.hxx index 3bdb3d3a7..d00acf220 100644 --- a/src/MEDLoader/SauvWriter.hxx +++ b/src/MEDLoader/SauvWriter.hxx @@ -52,6 +52,7 @@ namespace MEDCoupling MEDLOADER_EXPORT void write(const std::string& fileName); MEDLOADER_EXPORT void setCpyGrpIfOnASingleFamilyStatus(bool status); MEDLOADER_EXPORT bool getCpyGrpIfOnASingleFamilyStatus() const; + MEDLOADER_EXPORT std::string getClassName() const override { return std::string("SauvWriter"); } private: SauvWriter(); std::size_t getHeapMemorySizeWithoutChildren() const;