]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
22364: EDF SMESH: Create Mesh dialog box improvement: hide inapplicable algorithms...
authoreap <eap@opencascade.com>
Tue, 25 Feb 2014 14:50:48 +0000 (18:50 +0400)
committereap <eap@opencascade.com>
Tue, 25 Feb 2014 14:50:48 +0000 (18:50 +0400)
+  /*!
+   * \brief Auto pointer
+   */
+  template <typename TOBJ> struct Deleter

src/SMESHUtils/SMESH_TypeDefs.hxx

index 18ca428c1bbc9bbccae70711d2b2b2222052b509..2d116bf9c1efeb317c0a27ae29b4c3b9f1134e89 100644 (file)
@@ -72,6 +72,30 @@ namespace SMESHUtils
     TVECTOR v2( vec );
     vec.swap( v2 );
   }
+  /*!
+   * \brief Auto pointer
+   */
+  template <typename TOBJ>
+  struct Deleter
+  {
+    TOBJ* _obj;
+    Deleter( TOBJ* obj ): _obj( obj ) {}
+    ~Deleter() { delete _obj; _obj = 0; }
+  private:
+    Deleter( const Deleter& );
+  };
+  /*!
+   * \brief Auto pointer to array
+   */
+  template <typename TOBJ>
+  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 <NCollection_DefineIndexedMap.hxx>
-
-// #include <TopoDS_Shape.hxx>
-
-///  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