X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FMEDCouplingRefCountObject.i;h=48003ef559df723474de5192f32e7276d27e03c7;hb=9f966e0ed55cc976b59a17318a7be82445529eda;hp=cfd9fdfdd40d9d96d40b326c8ab37f4c8aae78d3;hpb=6c3d35ba88b2b922633a39472f53fa5da11f2e8e;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i b/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i index cfd9fdfdd..48003ef55 100644 --- a/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i +++ b/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i @@ -1,9 +1,9 @@ -// Copyright (C) 2007-2013 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 // License as published by the Free Software Foundation; either -// version 2.1 of the License. +// 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 @@ -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 c(self->getAllTheProgeny()); + PyObject *ret(PyList_New(c.size())); + for(std::size_t i=0;i cppObjs; @@ -96,7 +106,6 @@ namespace ParaMEDMEM bool decrRef() const; void incrRef() const; int getRCValue() const; - RefCountObjectOnly& operator=(const RefCountObjectOnly& other); protected: ~RefCountObjectOnly(); }; @@ -130,6 +139,15 @@ namespace ParaMEDMEM #endif } + bool MEDCouplingHasSciPyBindings() + { +#ifdef WITH_SCIPY + return true; +#else + return false; +#endif + } + std::string MEDCouplingCompletionScript() throw(INTERP_KERNEL::Exception) { static const char script[]="import rlcompleter,readline\nreadline.parse_and_bind('tab:complete')"; @@ -139,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(),)) +%}