From: eap Date: Tue, 25 Feb 2014 14:50:48 +0000 (+0400) Subject: 22364: EDF SMESH: Create Mesh dialog box improvement: hide inapplicable algorithms... X-Git-Tag: V7_4_0a1~57 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=e8f98d7a50e4bf554112421bec078c1b5e274c98;p=modules%2Fsmesh.git 22364: EDF SMESH: Create Mesh dialog box improvement: hide inapplicable algorithms/hypotheses + /*! + * \brief Auto pointer + */ + template struct Deleter --- diff --git a/src/SMESHUtils/SMESH_TypeDefs.hxx b/src/SMESHUtils/SMESH_TypeDefs.hxx index 18ca428c1..2d116bf9c 100644 --- a/src/SMESHUtils/SMESH_TypeDefs.hxx +++ b/src/SMESHUtils/SMESH_TypeDefs.hxx @@ -72,6 +72,30 @@ namespace SMESHUtils TVECTOR v2( vec ); vec.swap( v2 ); } + /*! + * \brief Auto pointer + */ + template + struct Deleter + { + TOBJ* _obj; + Deleter( TOBJ* obj ): _obj( obj ) {} + ~Deleter() { delete _obj; _obj = 0; } + private: + Deleter( const Deleter& ); + }; + /*! + * \brief Auto pointer to array + */ + template + struct ArrayDeleter + { + TOBJ* _obj; + ArrayDeleter( TOBJ* obj ): _obj( obj ) {} + ~ArrayDeleter() { delete [] _obj; _obj = 0; } + private: + ArrayDeleter( const ArrayDeleter& ); + }; } //======================================================================= @@ -171,46 +195,4 @@ DEFINE_BASECOLLECTION (SMESH_BaseCollectionNodePtr, SMDS_MeshNodePtr) DEFINE_SEQUENCE(SMESH_SequenceOfNode, SMESH_BaseCollectionNodePtr, SMDS_MeshNodePtr) -// -------------------------------------------------------------------------------- -// #include "SMESHDS_DataMapOfShape.hxx" - -// #include - -// #include - -/// Class SMESH_IndexedMapOfShape - -// DEFINE_BASECOLLECTION (SMESH_BaseCollectionShape, TopoDS_Shape) -// DEFINE_INDEXEDMAP (SMESH_IndexedMapOfShape, SMESH_BaseCollectionShape, TopoDS_Shape) - -/// Class SMESH_IndexedDataMapOfShapeIndexedMapOfShape - -// DEFINE_BASECOLLECTION (SMESH_BaseCollectionIndexedMapOfShape, SMESH_IndexedMapOfShape) -// DEFINE_INDEXEDDATAMAP (SMESH_IndexedDataMapOfShapeIndexedMapOfShape, -// SMESH_BaseCollectionIndexedMapOfShape, TopoDS_Shape, -// SMESH_IndexedMapOfShape) - -// -------------------------------------------------------------------------------- -// class SMESH_DataMapOfElemPtrSequenceOfElemPtr - -// SMESHUtils_EXPORT -// inline Standard_Integer HashCode(SMDS_MeshElementPtr theElem, -// const Standard_Integer theUpper) -// { -// void* anElem = (void*) theElem; -// return HashCode(anElem,theUpper); -// } - -// SMESHUtils_EXPORT -// inline Standard_Boolean IsEqual(SMDS_MeshElementPtr theOne, -// SMDS_MeshElementPtr theTwo) -// { -// return theOne == theTwo; -// } - -// DEFINE_BASECOLLECTION (SMESH_BaseCollectionSequenceOfElemPtr, SMESH_SequenceOfElemPtr) -// DEFINE_DATAMAP (SMESH_DataMapOfElemPtrSequenceOfElemPtr, -// SMESH_BaseCollectionSequenceOfElemPtr, -// SMDS_MeshElementPtr, SMESH_SequenceOfElemPtr) - #endif