X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCoupling_Swig%2FMEDCouplingRefCountObject.i;h=031f0c380697c1740d9e5cb6a48b5eada59e6436;hb=a019ec6e72f540d3378f3e869c2b19bf4886459c;hp=0db2e7e7ee9b41bf939ff930d498552398d66d92;hpb=fb512e2b77325290aaa2b4c9fd8f22d5949b6369;p=tools%2Fmedcoupling.git diff --git a/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i b/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i index 0db2e7e7e..031f0c380 100644 --- a/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i +++ b/src/MEDCoupling_Swig/MEDCouplingRefCountObject.i @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2014 CEA/DEN, EDF R&D +// Copyright (C) 2007-2016 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,14 +29,14 @@ namespace INTERP_KERNEL %extend { std::string __str__() const - { - return std::string(self->what()); - } + { + return std::string(self->what()); + } } }; } -namespace ParaMEDMEM +namespace MEDCoupling { class TimeLabel { @@ -49,7 +49,7 @@ namespace ParaMEDMEM }; } -namespace ParaMEDMEM +namespace MEDCoupling { typedef enum { @@ -62,12 +62,14 @@ namespace ParaMEDMEM int MEDCouplingSizeOfVoidStar(); bool MEDCouplingByteOrder(); const char *MEDCouplingByteOrderStr(); - + bool IsCXX11Compiled(); + class BigMemoryObject { 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 @@ -77,14 +79,23 @@ namespace ParaMEDMEM std::vector c(self->getDirectChildren()); PyObject *ret(PyList_New(c.size())); for(std::size_t i=0;i c(self->getAllTheProgeny()); + PyObject *ret(PyList_New(c.size())); + for(std::size_t i=0;i cppObjs; - convertFromPyObjVectorOfObj(objs,SWIGTYPE_p_ParaMEDMEM__BigMemoryObject,"BigMemoryObject",cppObjs); + convertFromPyObjVectorOfObj(objs,SWIGTYPE_p_MEDCoupling__BigMemoryObject,"BigMemoryObject",cppObjs); return BigMemoryObject::GetHeapMemorySizeOfObjs(cppObjs); } } @@ -105,6 +116,29 @@ namespace ParaMEDMEM protected: ~RefCountObject(); }; + + class GlobalDict + { + public: + static GlobalDict *GetInstance() throw(INTERP_KERNEL::Exception); + bool hasKey(const std::string& key) const throw(INTERP_KERNEL::Exception); + std::string value(const std::string& key) const throw(INTERP_KERNEL::Exception); + std::vector keys() const throw(INTERP_KERNEL::Exception); + void erase(const std::string& key) throw(INTERP_KERNEL::Exception); + void clear() throw(INTERP_KERNEL::Exception); + void setKeyValue(const std::string& key, const std::string& value) throw(INTERP_KERNEL::Exception); + void setKeyValueForce(const std::string& key, const std::string& value) throw(INTERP_KERNEL::Exception); + private: + GlobalDict(); + public: + %extend + { + std::string __str__() const + { + return self->printSelf(); + } + } + }; } %inline @@ -147,3 +181,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(),)) +%}