]> SALOME platform Git repositories - modules/geom.git/blobdiff - src/GEOMBase/GEOM_GenericObjPtr.h
Salome HOME
0021672: [CEA 565] Dump Study from script
[modules/geom.git] / src / GEOMBase / GEOM_GenericObjPtr.h
index 61d017970dd65b0f734a5a2bfde7bb6712c65afe..b4ece1236a6295b2f3951bee9dd11e4d8e1a661c 100644 (file)
@@ -1,23 +1,23 @@
-//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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.
+// 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.
+// 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
+// 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
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //  File   : GEOM_GenericObjPtr.h
 //  Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com)
@@ -25,6 +25,8 @@
 #ifndef GEOM_GenericObjPtr_H
 #define GEOM_GenericObjPtr_H
 
+#include "GEOM_GEOMBase.hxx"
+
 #include "SALOMEconfig.h"
 #include CORBA_SERVER_HEADER(GEOM_Gen)
 
@@ -37,7 +39,7 @@ namespace GEOM
     This class can be used in conjunction with the references to the CORBA objects which
     interfaces are inherited from the SALOME::GenericObj CORBA interface.
 
-    The smart pointer class automatically invokes Register() / Destroy() functions of th
+    The smart pointer class automatically invokes Register() / UnRegister() functions of th
     interface in order to prevent memory leaks and other such problems caused by improper
     usage of the CORBA references.
 
@@ -89,10 +91,10 @@ namespace GEOM
     }
 
     //! Decrement counter for the object.
-    void Destroy()
+    void UnRegister()
     {
       if ( !CORBA::is_nil( this->myObject ) ) {
-       this->myObject->Destroy();
+       this->myObject->UnRegister();
        this->myObject = TInterface::_nil();
       }
     }
@@ -119,13 +121,13 @@ namespace GEOM
     //! Destroy pointer and remove the reference to the object.
     ~GenericObjPtr()
     {
-      this->Destroy();
+      this->UnRegister();
     }
     
     //! Assign object to reference and remove reference to an old object.
     GenericObjPtr& operator=( TInterfacePtr theObject )
     {
-      this->Destroy();
+      this->UnRegister();
       this->myObject = TInterface::_duplicate( theObject );
       this->Register();
       return *this;
@@ -134,7 +136,7 @@ namespace GEOM
     //! Assign object to reference and remove reference to an old object.
     GenericObjPtr& operator=( const GenericObjPtr& thePointer )
     {
-      this->Destroy();
+      this->UnRegister();
       this->myObject = thePointer.myObject;
       this->Register();
       return *this;
@@ -184,7 +186,7 @@ namespace GEOM
     //! Initialize pointer to the given generic object reference and take ownership on it.
     void take( TInterfacePtr theObject )
     {
-      this->Destroy();
+      this->UnRegister();
       this->myObject = TInterface::_duplicate( theObject );
     }
 
@@ -209,7 +211,7 @@ namespace GEOM
     //! Nullify pointer.
     void nullify()
     {
-      this->Destroy();
+      this->UnRegister();
     }
   };
   
@@ -228,7 +230,7 @@ namespace GEOM
   typedef GenericObjPtr<GEOM::GEOM_IGroupOperations>     GroupOpPtr;
   typedef GenericObjPtr<GEOM::GEOM_IAdvancedOperations>  AdvancedOpPtr;
 
-  template<> bool GenericObjPtr<GEOM::GEOM_Object>::isSame( GEOM::GEOM_Object_ptr theLeft, GEOM::GEOM_Object_ptr theRight );
+  template<> bool GEOMBASE_EXPORT GenericObjPtr<GEOM::GEOM_Object>::isSame( GEOM::GEOM_Object_ptr theLeft, GEOM::GEOM_Object_ptr theRight );
 }
 
 #endif // GEOM_GenericObjPtr_H