*/
void CorbaPyDouble::put(CORBA::Any *data) throw(ConversionException)
{
- CORBA::Double d;
- *data >>=d;
- PyObject *ob;
- {
InterpreterUnlocker loc;
- ob=PyFloat_FromDouble(d);
+ PyObject* ob=convertCorbaPyObject(edGetType(),data);
DEBTRACE("ob refcnt: " << ob->ob_refcnt );
- }
_port->put(ob);
Py_DECREF(ob);
}
*/
void CorbaPyInt::put(CORBA::Any *data) throw(ConversionException)
{
- CORBA::Long l;
- *data >>=l;
- PyObject *ob;
- {
InterpreterUnlocker loc;
- ob=PyLong_FromLong(l);
+ PyObject* ob=convertCorbaPyObject(edGetType(),data);
DEBTRACE("ob refcnt: " << ob->ob_refcnt );
- }
_port->put(ob);
Py_DECREF(ob);
}
*/
void CorbaPyString::put(CORBA::Any *data) throw(ConversionException)
{
- const char *s;
- *data >>=s;
- PyObject *ob;
- {
InterpreterUnlocker loc;
- ob=PyString_FromString(s);
+ PyObject* ob=convertCorbaPyObject(edGetType(),data);
DEBTRACE("ob refcnt: " << ob->ob_refcnt );
- }
_port->put(ob);
Py_DECREF(ob);
}
*/
void CorbaPyBool::put(CORBA::Any *data) throw(ConversionException)
{
+ InterpreterUnlocker loc;
PyObject* ob=convertCorbaPyObject(edGetType(),data);
+ DEBTRACE("ob refcnt: " << ob->ob_refcnt );
_port->put(ob);
Py_DECREF(ob);
}
*/
void CorbaPyObjref::put(CORBA::Any *data) throw(ConversionException)
{
- CORBA::Object_var ObjRef ;
- *data >>= (CORBA::Any::to_object ) ObjRef ;
- PyObject *ob;
- {
InterpreterUnlocker loc;
- //hold_lock is true: caller is supposed to hold the GIL.
- //omniorb will not take the GIL
- ob = getSALOMERuntime()->getApi()->cxxObjRefToPyObjRef(ObjRef, 1);
+ PyObject* ob=convertCorbaPyObject(edGetType(),data);
DEBTRACE("ob refcnt: " << ob->ob_refcnt );
- }
_port->put(ob);
Py_DECREF(ob);
}
*/
void CorbaPySequence::put(CORBA::Any *data) throw(ConversionException)
{
- PyObject *ob;
- {
InterpreterUnlocker loc;
- ob=convertCorbaPyObject(edGetType(),data);
+ PyObject* ob=convertCorbaPyObject(edGetType(),data);
DEBTRACE("ob refcnt: " << ob->ob_refcnt );
_port->put(ob);
Py_DECREF(ob);
- DEBTRACE("ob refcnt: " << ob->ob_refcnt );
- }
}
//!Class to convert a CORBA::Any struct into a PyObject struct
*/
void CorbaPyStruct::put(CORBA::Any *data) throw(ConversionException)
{
- PyObject *ob;
- {
- InterpreterUnlocker loc;
- ob=convertCorbaPyObject(edGetType(),data);
- DEBTRACE("ob refcnt: " << ob->ob_refcnt );
- _port->put(ob);
- Py_DECREF(ob);
- DEBTRACE("ob refcnt: " << ob->ob_refcnt );
- }
+ InterpreterUnlocker loc;
+ PyObject* ob=convertCorbaPyObject(edGetType(),data);
+ DEBTRACE("ob refcnt: " << ob->ob_refcnt );
+ _port->put(ob);
+ Py_DECREF(ob);
}