X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_TypeDefs.hxx;h=2d116bf9c1efeb317c0a27ae29b4c3b9f1134e89;hb=69f064e1222d71a85b8ac1e11d82e0480b6d6cea;hp=18ca428c1bbc9bbccae70711d2b2b2222052b509;hpb=b0a908c0d20341651771d0249fb10882f54b2aad;p=modules%2Fsmesh.git 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