-// Copyright (C) 2006-2008 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2023 CEA, EDF
//
-// 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.
+// 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, 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
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// Lesser General Public License for more details.
//
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
//
+
#include "TypeConversions.hxx"
#include "NeutralPythonConv.hxx"
#include "RuntimeSALOME.hxx"
using namespace YACS::ENGINE;
using namespace std;
-void NeutralPyDouble::put(const void *data) throw(ConversionException)
+void NeutralPyDouble::put(const void *data)
{
put((YACS::ENGINE::Any *)data);
}
/*!
* \param data : YACS::ENGINE::Any object
*/
-void NeutralPyDouble::put(YACS::ENGINE::Any *data) throw(ConversionException)
+void NeutralPyDouble::put(YACS::ENGINE::Any *data)
{
InterpreterUnlocker loc;
PyObject* ob=convertNeutralPyObject(edGetType(),data);
}
-void NeutralPyInt::put(const void *data) throw(ConversionException)
+void NeutralPyInt::put(const void *data)
{
put((YACS::ENGINE::Any *)data);
}
/*!
* \param data : YACS::ENGINE::Any object
*/
-void NeutralPyInt::put(YACS::ENGINE::Any *data) throw(ConversionException)
+void NeutralPyInt::put(YACS::ENGINE::Any *data)
{
InterpreterUnlocker loc;
PyObject* ob=convertNeutralPyObject(edGetType(),data);
Py_DECREF(ob);
}
-void NeutralPyString::put(const void *data) throw(ConversionException)
+void NeutralPyString::put(const void *data)
{
put((YACS::ENGINE::Any *)data);
}
/*!
* \param data : YACS::ENGINE::Any object
*/
-void NeutralPyString::put(YACS::ENGINE::Any *data) throw(ConversionException)
+void NeutralPyString::put(YACS::ENGINE::Any *data)
{
InterpreterUnlocker loc;
PyObject* ob=convertNeutralPyObject(edGetType(),data);
Py_DECREF(ob);
}
-void NeutralPyBool::put(const void *data) throw(ConversionException)
+void NeutralPyBool::put(const void *data)
{
put((YACS::ENGINE::Any *)data);
}
/*!
* \param data : YACS::ENGINE::Any object
*/
-void NeutralPyBool::put(YACS::ENGINE::Any *data) throw(ConversionException)
+void NeutralPyBool::put(YACS::ENGINE::Any *data)
{
InterpreterUnlocker loc;
PyObject* ob=convertNeutralPyObject(edGetType(),data);
Py_DECREF(ob);
}
-void NeutralPyObjref::put(const void *data) throw(ConversionException)
+void NeutralPyObjref::put(const void *data)
{
put((YACS::ENGINE::Any *)data);
}
/*!
* \param data : Neutral::Any object
*/
-void NeutralPyObjref::put(YACS::ENGINE::Any *data) throw(ConversionException)
+void NeutralPyObjref::put(YACS::ENGINE::Any *data)
{
InterpreterUnlocker loc;
PyObject* ob=convertNeutralPyObject(edGetType(),data);
DEBTRACE( "ob refcnt: " << ob->ob_refcnt );
}
-void NeutralPySequence::put(const void *data) throw(ConversionException)
+void NeutralPySequence::put(const void *data)
{
put((YACS::ENGINE::Any *)data);
}
/*!
* \param data : Neutral::Any object
*/
-void NeutralPySequence::put(YACS::ENGINE::Any *data) throw(ConversionException)
+void NeutralPySequence::put(YACS::ENGINE::Any *data)
{
DEBTRACE( "--------NeutralPySequence::put" );
InterpreterUnlocker loc;
DEBTRACE( "ob refcnt: " << ob->ob_refcnt );
}
+void NeutralPyStruct::put(const void *data)
+{
+ put((YACS::ENGINE::Any *)data);
+}
+//!Convert a Neutral::Any Struct to a PyObject Struct
+/*!
+ * \param data : Neutral::Any object
+ */
+void NeutralPyStruct::put(YACS::ENGINE::Any *data)
+{
+ InterpreterUnlocker loc;
+ PyObject* ob=convertNeutralPyObject(edGetType(),data);
+ DEBTRACE( "ob refcnt: " << ob->ob_refcnt );
+ _port->put(ob);
+ Py_DECREF(ob);
+ DEBTRACE( "ob refcnt: " << ob->ob_refcnt );
+}