Salome HOME
Returned value that informs the caller about the nature of returned coords pointer.
[tools/medcoupling.git] / src / MEDCoupling / MEDCouplingAutoRefCountObjectPtr.hxx
index f9dc0efe3978676f3b9f5d80185a2171d6231c1b..dc6383933de8b58d48e22dd6338c1806cd366cb8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2012  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2013  CEA/DEN, EDF R&D
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -16,6 +16,7 @@
 //
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+// Author : Anthony Geay (CEA/DEN)
 
 #ifndef __PARAMEDMEM_MEDCOUPLINGAUTOREFCOUNTOBJECTPTR_HXX__
 #define __PARAMEDMEM_MEDCOUPLINGAUTOREFCOUNTOBJECTPTR_HXX__
@@ -40,6 +41,7 @@ namespace ParaMEDMEM
     const T& operator*() const { return *_ptr; }
     operator T *() { return _ptr; }
     operator const T *() const { return _ptr; }
+    T *retn() { if(_ptr) _ptr->incrRef(); return _ptr; }
   private:
     void referPtr(T *ptr) { _ptr=ptr; if(_ptr) _ptr->incrRef(); }
     void destroyPtr() { if(_ptr) _ptr->decrRef(); }