X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FBasics%2FBasicsGenericDestructor.hxx;h=0fec8e901d327b919908c44c7a65fcedd58e4df9;hb=d1070d09cfbba6d9b72d8f2ca8d07d23f296686c;hp=9ccbb174922d7d32da7a1b7a87fbf8f1d67de1af;hpb=f14439749926cca959747bb79fda10529520bd0b;p=modules%2Fkernel.git diff --git a/src/Basics/BasicsGenericDestructor.hxx b/src/Basics/BasicsGenericDestructor.hxx index 9ccbb1749..0fec8e901 100644 --- a/src/Basics/BasicsGenericDestructor.hxx +++ b/src/Basics/BasicsGenericDestructor.hxx @@ -1,51 +1,35 @@ -// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA) +// Copyright (C) 2007-2024 CEA, EDF, OPEN CASCADE // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, -// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS -// -// This library is free software; you can redistribute it and/or -// modify it under the terms of the GNU Lesser General Public -// License as published by the Free Software Foundation; either -// version 2.1 of the License. -// -// This library is distributed in the hope that it will be useful, -// but WITHOUT ANY WARRANTY; without even the implied warranty of -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -// Lesser General Public License for more details. -// -// You should have received a copy of the GNU Lesser General Public -// License along with this library; if not, write to the Free Software -// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -// -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. // +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. // +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +// SALOME Basics : general SALOME definitions and tools (C++ part - no CORBA) // File : BasicGenericDestructor.hxx // Author : Antoine YESSAYAN, Paul RASCLE, EDF // Module : SALOME // $Header$ - +// #ifndef _BASICGENERICDESTRUCTOR_HXX_ #define _BASICGENERICDESTRUCTOR_HXX_ -#ifdef WNT - #if defined BASICS_EXPORTS - #if defined WIN32 - #define BASICS_EXPORT __declspec( dllexport ) - #else - #define BASICS_EXPORT - #endif - #else - #if defined WIN32 - #define BASICS_EXPORT __declspec( dllimport ) - #else - #define BASICS_EXPORT - #endif - #endif -#else - #define BASICS_EXPORT -#endif +#include "SALOME_Basics.hxx" #include #include @@ -65,6 +49,10 @@ #define DEVTRACE(msg) #endif +#ifdef WIN32 +#pragma warning(disable:4251) // Warning DLL Interface ... +#endif + // ============================================================================ /*! * The PROTECTED_DELETE base class provides a protected destructor. @@ -79,7 +67,7 @@ * This class is utilised with GENERIC_DESTRUCTOR and DESTRUCTOR_OF, * to program automatic deletion of objects at the end of the process, while * keeping the possibility of an early destruction, if required. This is used - * for unit testing and trace mecanism. + * for unit testing and trace mechanism. */ // ============================================================================ @@ -121,7 +109,7 @@ public : static std::list *Destructors; virtual ~GENERIC_DESTRUCTOR() {}; - static const int Add(GENERIC_DESTRUCTOR &anObject); + static int Add(GENERIC_DESTRUCTOR &anObject); virtual void operator()(void) = 0; }; @@ -139,7 +127,7 @@ public : * * Note that neither ptrPoint, nor ptrDestruct should be destroyed by the user. * - * The destruction object must be created dynamically because it suscribes + * The destruction object must be created dynamically because it subscribes * itself in the list of destruction to be performed at the end of the process. */ // ============================================================================ @@ -156,7 +144,7 @@ public: _objectPtr(&anObject) { DEVTRACE(" DESTRUCTOR_OF " << typeid(anObject).name() - << " " << _objectPtr << " " << this ); + << " " << _objectPtr << " " << this ); PROTECTED_DELETE::addObj(_objectPtr); assert(GENERIC_DESTRUCTOR::Add(*this) >= 0); } @@ -170,9 +158,9 @@ public: { if (_objectPtr) { - DEVTRACE("DESTRUCTOR_OF<>::operator() " << _objectPtr); - if (_objectPtr) PROTECTED_DELETE::deleteInstance(_objectPtr); - _objectPtr = NULL; + DEVTRACE("DESTRUCTOR_OF<>::operator() " << _objectPtr); + if (_objectPtr) PROTECTED_DELETE::deleteInstance(_objectPtr); + _objectPtr = NULL; } }