X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2Fruntime_swig%2FSALOMERuntime.i;h=40a200ad244b428f66c54499ffddeadbc3dd37e8;hb=1894c52d0838df8676e770bef061fc23ca436452;hp=1de04b0af039bae26b4f74cdd798289fd3859c72;hpb=24e5af87d0c026752fdf5191961e536ae3b0eb5d;p=modules%2Fyacs.git diff --git a/src/runtime_swig/SALOMERuntime.i b/src/runtime_swig/SALOMERuntime.i index 1de04b0af..40a200ad2 100644 --- a/src/runtime_swig/SALOMERuntime.i +++ b/src/runtime_swig/SALOMERuntime.i @@ -1,4 +1,4 @@ -// Copyright (C) 2006-2016 CEA/DEN, EDF R&D +// Copyright (C) 2006-2024 CEA, EDF // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -66,6 +66,7 @@ #include "PyStdout.hxx" #include "ExecutorSwig.hxx" #include +#include "Catalog.hxx" %} // ---------------------------------------------------------------------------- @@ -78,10 +79,10 @@ if (!omnipy) { PyErr_SetString(PyExc_ImportError,(char*)"Cannot import _omnipy"); - return; + return NULL; } PyObject* pyapi = PyObject_GetAttrString(omnipy, (char*)"API"); - api = (omniORBPYAPI*)PyCObject_AsVoidPtr(pyapi); + api = (omniORBpyAPI*)PyCapsule_GetPointer(pyapi,"_omnipy.API"); Py_DECREF(pyapi); %} @@ -227,8 +228,11 @@ namespace YACS // becomes a real derived class, this will have to be changed. %rename(OptimizerAlgSync) YACS::ENGINE::PyOptimizerAlgBase; %rename(OptimizerAlgASync) YACS::ENGINE::PyOptimizerAlgASync; + %include "PyOptimizerAlg.hxx" +%newobject YACS::ENGINE::RuntimeSALOME::createAnyPyObject; + %extend YACS::ENGINE::RuntimeSALOME { PyObject *createContainer(const std::string& kind="") @@ -236,4 +240,10 @@ namespace YACS YACS::ENGINE::Container *ret(self->createContainer(kind)); return convertContainer2(ret,SWIG_POINTER_OWN | 0); } + + Any* createAnyPyObject(PyObject * pyobj) + { + return convertPyObjectNeutral(self->getBuiltinCatalog()->_typeMap["pyobj"], + pyobj); + } }