From: eap Date: Wed, 18 Jan 2012 12:07:14 +0000 (+0000) Subject: Add "const char* name" argument to consrtucctor of SMESH_subMeshEventListener X-Git-Tag: V6_5_0a1~197 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=fbae18cd7f281bde3b207949213992efa16a357b;p=modules%2Fsmesh.git Add "const char* name" argument to consrtucctor of SMESH_subMeshEventListener --- diff --git a/src/SMESH/SMESH_subMeshEventListener.hxx b/src/SMESH/SMESH_subMeshEventListener.hxx index a978c4591..bc3246a99 100644 --- a/src/SMESH/SMESH_subMeshEventListener.hxx +++ b/src/SMESH/SMESH_subMeshEventListener.hxx @@ -47,8 +47,16 @@ class SMESH_EXPORT SMESH_subMeshEventListener bool myIsDeletable; //!< if true, it will be deleted by SMESH_subMesh mutable std::set myBusySM; //!< to avoid infinite recursion via events friend class SMESH_subMesh; -public: - SMESH_subMeshEventListener(bool isDeletable):myIsDeletable(isDeletable) {} +#ifdef _DEBUG_ + const char* myName; //!< identifier used for debug +#endif + + public: + SMESH_subMeshEventListener(bool isDeletable, const char* name) :myIsDeletable(isDeletable) +#ifdef _DEBUG_ + ,myName(name) +#endif + {} bool IsDeletable() const { return myIsDeletable; } /*! * \brief Do something on a certain event diff --git a/src/SMESH_I/SMESH_MeshEditor_i.cxx b/src/SMESH_I/SMESH_MeshEditor_i.cxx index 4c034b99c..981a90ac9 100644 --- a/src/SMESH_I/SMESH_MeshEditor_i.cxx +++ b/src/SMESH_I/SMESH_MeshEditor_i.cxx @@ -169,7 +169,8 @@ namespace { SMESH_Mesh* myMesh; string myMeshPartIOR; //!< Constructor - TSearchersDeleter(): SMESH_subMeshEventListener( false ), // won't be deleted by submesh + TSearchersDeleter(): SMESH_subMeshEventListener( false, // won't be deleted by submesh + "SMESH_MeshEditor_i::TSearchersDeleter"), myMesh(0) {} //!< Delete theNodeSearcher static void Delete() diff --git a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx index dcce058db..a1f94b36d 100644 --- a/src/StdMeshers/StdMeshers_Cartesian_3D.cxx +++ b/src/StdMeshers/StdMeshers_Cartesian_3D.cxx @@ -1714,15 +1714,16 @@ namespace { /*! * \brief Event listener setting/unsetting _alwaysComputed flag to - * submeshes of inferior levels to avoid their computing + * submeshes of inferior levels to prevent their computing */ struct _EventListener : public SMESH_subMeshEventListener { string _algoName; _EventListener(const string& algoName): - SMESH_subMeshEventListener(/*isDeletable=*/true), _algoName(algoName) {} - + SMESH_subMeshEventListener(/*isDeletable=*/true,"StdMeshers_Cartesian_3D::_EventListener"), + _algoName(algoName) + {} // -------------------------------------------------------------------------------- // setting/unsetting _alwaysComputed flag to submeshes of inferior levels // diff --git a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx index fb8c86eb9..6df82b480 100644 --- a/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx +++ b/src/StdMeshers/StdMeshers_CompositeSegment_1D.cxx @@ -150,7 +150,9 @@ namespace { struct VertexNodesRestoringListener : public SMESH_subMeshEventListener { - VertexNodesRestoringListener():SMESH_subMeshEventListener(0) // won't be deleted by submesh + VertexNodesRestoringListener(): + SMESH_subMeshEventListener(0, // won't be deleted by submesh + "StdMeshers_CompositeSegment_1D::VertexNodesRestoringListener") {} /*! * \brief Restore nodes on internal vertices of a complex side diff --git a/src/StdMeshers/StdMeshers_Import_1D.cxx b/src/StdMeshers/StdMeshers_Import_1D.cxx index 562a1f8be..b95e12b90 100644 --- a/src/StdMeshers/StdMeshers_Import_1D.cxx +++ b/src/StdMeshers/StdMeshers_Import_1D.cxx @@ -246,7 +246,8 @@ namespace // INTERNAL STUFF typedef map< SMESH_Mesh*, list< _ImportData > > TMesh2ImpData; TMesh2ImpData _tgtMesh2ImportData; - _Listener():SMESH_subMeshEventListener(/*isDeletable=*/false){} + _Listener():SMESH_subMeshEventListener(/*isDeletable=*/false, + "StdMeshers_Import_1D::_Listener") {} public: // return poiter to a static listener diff --git a/src/StdMeshers/StdMeshers_Penta_3D.cxx b/src/StdMeshers/StdMeshers_Penta_3D.cxx index 3025b1bf9..fd52d5877 100644 --- a/src/StdMeshers/StdMeshers_Penta_3D.cxx +++ b/src/StdMeshers/StdMeshers_Penta_3D.cxx @@ -849,7 +849,8 @@ void StdMeshers_Penta_3D::MakeMeshOnFxy1() // assure that mesh on the top face will be cleaned when it is cleaned // on the bottom face SMESH_subMesh* volSM = pMesh->GetSubMesh( myTool->GetSubShape() ); - volSM->SetEventListener( new SMESH_subMeshEventListener(true), + volSM->SetEventListener( new SMESH_subMeshEventListener(true, // deletable by SMESH_subMesh + "StdMeshers_Penta_3D"), SMESH_subMeshEventListenerData::MakeData( aSubMesh1 ), aSubMesh0 ); // translate CLEAN event of aSubMesh0 to aSubMesh1 } diff --git a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx index 09a2acf4f..8dab2b8bc 100644 --- a/src/StdMeshers/StdMeshers_ProjectionUtils.cxx +++ b/src/StdMeshers/StdMeshers_ProjectionUtils.cxx @@ -2069,8 +2069,8 @@ namespace { struct HypModifWaiter: SMESH_subMeshEventListener { - HypModifWaiter():SMESH_subMeshEventListener(0){} // won't be deleted by submesh - + HypModifWaiter():SMESH_subMeshEventListener(false,// won't be deleted by submesh + "StdMeshers_ProjectionUtils::HypModifWaiter") {} void ProcessEvent(const int event, const int eventType, SMESH_subMesh* subMesh, EventListenerData*, const SMESH_Hypothesis*) { @@ -2102,7 +2102,8 @@ namespace { //================================================================================ SMESH_subMeshEventListener* GetSrcSubMeshListener() { - static SMESH_subMeshEventListener srcListener(0); // won't be deleted by submesh + static SMESH_subMeshEventListener srcListener(false, // won't be deleted by submesh + "StdMeshers_ProjectionUtils::SrcSubMeshListener"); return &srcListener; } } diff --git a/src/StdMeshers/StdMeshers_Propagation.cxx b/src/StdMeshers/StdMeshers_Propagation.cxx index 8bda60ea4..db3316bae 100644 --- a/src/StdMeshers/StdMeshers_Propagation.cxx +++ b/src/StdMeshers/StdMeshers_Propagation.cxx @@ -449,7 +449,8 @@ namespace { //================================================================================ PropagationMgr::PropagationMgr() - : SMESH_subMeshEventListener( false ) // won't be deleted by submesh + : SMESH_subMeshEventListener( false, // won't be deleted by submesh + "StdMeshers_Propagation::PropagationMgr") {} //================================================================================ /*! diff --git a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx index 3b7b34f13..b153b077b 100644 --- a/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx +++ b/src/StdMeshers/StdMeshers_RadialQuadrangle_1D2D.cxx @@ -146,7 +146,8 @@ namespace */ class TEdgeMarker : public SMESH_subMeshEventListener { - TEdgeMarker(): SMESH_subMeshEventListener(/*isDeletable=*/false) {} + TEdgeMarker(): SMESH_subMeshEventListener(/*isDeletable=*/false, + "StdMeshers_RadialQuadrangle_1D2D::TEdgeMarker") {} public: //!< Return static listener static SMESH_subMeshEventListener* getListener() diff --git a/src/StdMeshers/StdMeshers_ViscousLayers.cxx b/src/StdMeshers/StdMeshers_ViscousLayers.cxx index 4326b4f7a..1355a87e4 100644 --- a/src/StdMeshers/StdMeshers_ViscousLayers.cxx +++ b/src/StdMeshers/StdMeshers_ViscousLayers.cxx @@ -122,7 +122,9 @@ namespace VISCOUS */ class _SrinkShapeListener : SMESH_subMeshEventListener { - _SrinkShapeListener(): SMESH_subMeshEventListener(/*isDeletable=*/false) {} + _SrinkShapeListener() + : SMESH_subMeshEventListener(/*isDeletable=*/false, + "StdMeshers_ViscousLayers::_SrinkShapeListener") {} static SMESH_subMeshEventListener* Get() { static _SrinkShapeListener l; return &l; } public: virtual void ProcessEvent(const int event, @@ -162,7 +164,9 @@ namespace VISCOUS */ class _ViscousListener : SMESH_subMeshEventListener { - _ViscousListener(): SMESH_subMeshEventListener(/*isDeletable=*/false) {} + _ViscousListener(): + SMESH_subMeshEventListener(/*isDeletable=*/false, + "StdMeshers_ViscousLayers::_ViscousListener") {} static SMESH_subMeshEventListener* Get() { static _ViscousListener l; return &l; } public: virtual void ProcessEvent(const int event,