Salome HOME
Merge branch 'V8_0_BR'
[tools/medcoupling.git] / src / MEDCoupling_Swig / MEDCouplingRefCountObject.i
index 0db2e7e7ee9b41bf939ff930d498552398d66d92..48003ef559df723474de5192f32e7276d27e03c7 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2014  CEA/DEN, EDF R&D
+// Copyright (C) 2007-2015  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
@@ -29,9 +29,9 @@ namespace INTERP_KERNEL
     %extend
     {
       std::string __str__() const
-        {
-          return std::string(self->what());
-        }
+      {
+        return std::string(self->what());
+      }
     }
   };
 }
@@ -68,6 +68,7 @@ namespace ParaMEDMEM
   public:
     std::size_t getHeapMemorySize() const throw(INTERP_KERNEL::Exception);
     std::string getHeapMemorySizeStr() const throw(INTERP_KERNEL::Exception);
+    bool isObjectInTheProgeny(const BigMemoryObject *obj) const throw(INTERP_KERNEL::Exception);
     virtual std::size_t getHeapMemorySizeWithoutChildren() const throw(INTERP_KERNEL::Exception);
     virtual ~BigMemoryObject();
     %extend
@@ -81,6 +82,15 @@ namespace ParaMEDMEM
         return ret;
       }
 
+      PyObject *getAllTheProgeny() const throw(INTERP_KERNEL::Exception)
+      {
+        std::vector<const BigMemoryObject *> c(self->getAllTheProgeny());
+        PyObject *ret(PyList_New(c.size()));
+        for(std::size_t i=0;i<c.size();i++)
+          PyList_SetItem(ret,i,SWIG_NewPointerObj(SWIG_as_voidptr(c[i]),SWIGTYPE_p_ParaMEDMEM__BigMemoryObject, 0 | 0 ));
+        return ret;
+      }
+
       static std::size_t GetHeapMemorySizeOfObjs(PyObject *objs) throw(INTERP_KERNEL::Exception)
       {
         std::vector<const BigMemoryObject *> cppObjs;
@@ -147,3 +157,12 @@ namespace ParaMEDMEM
     return std::string(script);
   }
 }
+
+%pythoncode %{
+def INTERPKERNELExceptionReduceFunct(a,b):
+    ret=InterpKernelException.__new__(a)
+    ret.__init__(*b)
+    return ret
+def INTERPKERNELExceptionReduce(self):
+    return INTERPKERNELExceptionReduceFunct,(InterpKernelException,(self.what(),))
+%}