-// Copyright (C) 2006-2012 CEA/DEN, EDF R&D
+// Copyright (C) 2006-2019 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
#include "RuntimeSALOME.hxx"
#include "TypeConversions.hxx"
#include "TypeCode.hxx"
+#include "AutoLocker.hxx"
#include "CORBAPorts.hxx"
#include "PythonPorts.hxx"
#include "ServiceNode.hxx"
}
}
+void InputCorbaPort::releaseData()
+{//do nothing - to be implemented
+}
+
void InputCorbaPort::put(CORBA::Any *data) throw (ConversionException)
{
#ifdef REFCNT
DEBTRACE("refcount CORBA : " << ((omni::TypeCode_base*)data->pd_tc.in())->pd_ref_count);
#endif
- YACS::BASES::Lock lock(&_mutex);
+ YACS::BASES::AutoLocker<YACS::BASES::Mutex> lock(&_mutex);
#ifdef _DEVDEBUG_
display(data);
#endif
PyObject * InputCorbaPort::getPyObj()
{
- YACS::BASES::Lock lock(&_mutex);
+ YACS::BASES::AutoLocker<YACS::BASES::Mutex> lock(&_mutex);
CORBA::TypeCode_var tc=getAny()->type();
if (!tc->equivalent(CORBA::_tc_null))
return convertCorbaPyObject(edGetType(),getAny());
std::string InputCorbaPort::valToStr()
{
- int isString = PyString_Check(getPyObj());
+ int isString = PyBytes_Check(getPyObj());
PyObject *strPyObj = PyObject_Str(getPyObj());
- string val = PyString_AsString(strPyObj);
+ string val = PyBytes_AsString(strPyObj);
if (isString)
val = "\"" + val + "\"";
Py_DECREF(strPyObj);
InputPort *p;
{
- YACS::BASES::Lock lock(&_mutex);
+ YACS::BASES::AutoLocker<YACS::BASES::Mutex> lock(&_mutex);
#ifdef REFCNT
DEBTRACE("refcount CORBA : " << ((omni::TypeCode_base*)data->pd_tc.in())->pd_ref_count);
#endif
PyObject * OutputCorbaPort::getPyObj()
{
- YACS::BASES::Lock lock(&_mutex);
+ YACS::BASES::AutoLocker<YACS::BASES::Mutex> lock(&_mutex);
CORBA::TypeCode_var tc=getAny()->type();
if (!tc->equivalent(CORBA::_tc_null))
return convertCorbaPyObject(edGetType(),getAny());
std::string OutputCorbaPort::valToStr()
{
PyObject *strPyObj = PyObject_Str(getPyObj());
- string val = PyString_AsString(strPyObj);
+ string val = PyBytes_AsString(strPyObj);
Py_DECREF(strPyObj);
return val;
}