aPyFunc += "import omniORB\n" ;
aPyFunc += "print 'PyObjRef'\n" ;
aPyFunc += "def PyObjRef( IORObjStr ) :\n" ;
-// aPyFunc += " print 'PyObjRef',IORObjStr\n" ;
+ aPyFunc += " print 'PyObjRef',IORObjStr\n" ;
aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
+ aPyFunc += " print 'PyObjRef orb',orb\n" ;
aPyFunc += " objref = orb.string_to_object( IORObjStr )\n" ;
-// aPyFunc += " print IORObjStr,objref\n" ;
-// aPyFunc += " return objref,objref\n" ;
+ aPyFunc += " print 'PyObjRef IORObjStr objref',IORObjStr,objref\n" ;
aPyFunc += " return objref\n" ;
aPyFunc += "InitPyRunMethod.RunMethod( PyObjRef )\n" ;
if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
aPyFunc += "import CORBA\n" ;
aPyFunc += "import omniORB\n" ;
aPyFunc += "def PyObjIor( ObjRef ) :\n" ;
-// aPyFunc += " print 'PyObjIor',ObjRef\n" ;
+ aPyFunc += " print 'PyObjIor',ObjRef\n" ;
aPyFunc += " orb = CORBA.ORB_init( sys.argv , CORBA.ORB_ID )\n" ;
-// aPyFunc += " print 'PyObjIor',orb\n" ;
+ aPyFunc += " print 'PyObjIor orb',orb\n" ;
aPyFunc += " objIor = orb.object_to_string( ObjRef )\n" ;
-// aPyFunc += " print 'PyObjIor',ObjRef,objIor\n" ;
+ aPyFunc += " print 'PyObjIor ObjRef objIor',ObjRef,objIor\n" ;
aPyFunc += " return objIor\n" ;
aPyFunc += "InitPyRunMethod.RunMethod( PyObjIor )\n" ;
if ( PyRun_SimpleString( (char *) aPyFunc.c_str() ) ) {
int n_out = nOutParams ;
const char * sname;
- cdebug_in << "GraphExecutor::InNode::PyDynInvoke " << method << endl ;
+ cdebug_in << ThreadNo() << "GraphExecutor::InNode::PyDynInvoke " << method << " " << n_in
+ << " InArgs " << n_out << " OutArgs" << endl ;
CORBA::Any data ;
PyObject * ArgsList = NULL ;
- PyObject * ArgValue ;
- PyObject * ArgResult ;
- PyObject * Result ;
+ PyObject * ArgValue = NULL ;
+ PyObject * ArgResult = NULL ;
+ PyObject * Result = NULL ;
PyObject * MyPyObjRefList = NULL ;
PyObject * ResultObj = NULL ;
PyObject * MyPyObjIorList = NULL ;
data >>= t ;
ArgValue = Py_BuildValue( "s" , t ) ;
PyTuple_SetItem( ArgsList , i , ArgValue ) ;
- cdebug << "ArgIn" << i << " : " << sname << " Value " << t << " (string) "
+ cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value " << t << " (string) "
<< ArgsList->ob_refcnt << endl ;
break ;
}
data >>= d ;
ArgValue = Py_BuildValue( "d" , d ) ;
PyTuple_SetItem( ArgsList , i , ArgValue ) ;
- cdebug << "ArgIn" << i << " : " << sname << " Value " << d << " (double) "
+ cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value " << d << " (double) "
<< ArgsList->ob_refcnt << endl ;
break ;
}
data >>= l ;
ArgValue = Py_BuildValue( "l" , l ) ;
PyTuple_SetItem( ArgsList , i , ArgValue ) ;
- cdebug << "ArgIn" << i << " : " << sname << " Value " << l
+ cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value " << l
<< " (long) ArgsList->ob_refcnt" << ArgsList->ob_refcnt << endl ;
break ;
}
IORObjRef = ObjectToString( ObjRef ) ;
ObjValue = Py_BuildValue( "s" , IORObjRef ) ;
PyTuple_SetItem( MyPyObjRefList , 0 , ObjValue ) ;
- cdebug << "ArgIn" << i << " : " << sname << " Value " << IORObjRef << " (objref) "
+ cdebug << "ArgIn" << i << " : " << sname << method << " " << " Value " << IORObjRef << " (objref) "
<< MyPyObjRefList->ob_refcnt << endl ;
ResultObj = PyEval_CallObject( MyPyObjRef , MyPyObjRefList ) ;
cdebug << "MyPyObjRefList->ob_refcnt" << MyPyObjRefList->ob_refcnt << " "
<< "ResultObj->ob_refcnt" << ResultObj->ob_refcnt << endl ;
PyObject_Print( ResultObj , stdout , 0 ) ;
PyTuple_SetItem( ArgsList , i , ResultObj ) ;
- cdebug << "ArgIn" << i << " : " << sname << " Value (objref) ArgsList->ob_refcnt"
+ cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt"
<< ArgsList->ob_refcnt << " ResultObj->ob_refcnt" << ResultObj->ob_refcnt
<< endl ;
break ;
if ( ArgValue == NULL ) {
ArgValue = Result ;
}
+ if ( !PyString_Check( ArgValue ) ) {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (string)" << endl ;
+ }
t = PyString_AsString( ArgValue ) ;
data <<= t ;
- cdebug << "ArgOut" << i << " : " << sname << " Value " << t << " (string)"
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << t << " (string)"
<< endl ;
break ;
}
case CORBA::tk_double : {
double d ;
ArgValue = PyTuple_GetItem( Result , i ) ;
+ if ( !PyFloat_Check( ArgValue ) ) {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (double)" << endl ;
+ }
if ( ArgValue == NULL ) {
ArgValue = Result ;
}
d = PyFloat_AsDouble( ArgValue ) ;
data <<= d ;
- cdebug << "ArgOut" << i << " : " << sname << " Value " << d << " (double)"
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << d << " (double)"
<< endl ;
break ;
}
if ( ArgValue == NULL ) {
ArgValue = Result ;
}
+ if ( !PyInt_Check( ArgValue ) ) {
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " ERROR (long)" << endl ;
+ }
l = PyInt_AsLong( ArgValue ) ;
data <<= l ;
- cdebug << "ArgOut" << i << " : " << sname << " Value " << l << " (long)" << endl ;
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << l << " (long)" << endl ;
break ;
}
case CORBA::tk_objref : {
if ( ObjIor == NULL ) {
ObjIor = Result ;
}
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << "(object reference) "<< endl ;
+ cout << "ArgOut" << i << " : " << sname << " " << method << " Value " << "(object reference) : " ;
Py_INCREF( ObjIor ) ;
PyObject_Print( ObjIor , stdout , 0 ) ;
PyTuple_SetItem( MyPyObjIorList , 0 , ObjIor ) ;
ObjRef = StringToObject( IOR ) ;
data <<= ObjRef ;
IORObjRef = ObjectToString( ObjRef ) ;
- cdebug << "ArgOut" << i << " : " << sname << " Value " << "(object reference) "
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << "(object reference) "
<< IORObjRef << endl ;
}
else {
cdebug_out << "GraphExecutor::InNode::PyDynInvoke Error ResultIor == NULL"
- << endl ;
+ << method << " " << endl ;
RetVal = false ;
}
break ;
}
default : {
- cdebug << "ArgOut" << i << " : " << sname << " Value " << "(other ERROR)" << endl ;
+ cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << "(other ERROR)" << endl ;
}
}
outParams[i].Value = data ;
if ( MyPyObjIorList ) {
int cnt = MyPyObjIorList->ob_refcnt ;
- while ( cnt ) {
+ while ( cnt > 0 ) {
cnt = MyPyObjIorList->ob_refcnt - 1 ;
Py_DECREF( MyPyObjIorList ) ;
+ cdebug << "MyPyObjIorList->ob_refcnt" << MyPyObjIorList->ob_refcnt << endl ;
+ }
+ }
+ if ( ResultIor ) {
+ int cnt = ResultIor->ob_refcnt ;
+ while ( cnt > 0 ) {
+ cnt = ResultIor->ob_refcnt - 1 ;
Py_DECREF( ResultIor ) ;
- cdebug << "MyPyObjIorList->ob_refcnt" << MyPyObjIorList->ob_refcnt << " "
- << "ResultIor->ob_refcnt" << ResultIor->ob_refcnt << endl ;
+ cdebug << "ResultIor->ob_refcnt" << ResultIor->ob_refcnt << endl ;
}
}
Py_DECREF( Result ) ;
Py_DECREF( ArgsList ) ;
if ( MyPyObjRefList ) {
int cnt = MyPyObjRefList->ob_refcnt ;
- while ( cnt ) {
+ while ( cnt > 0 ) {
cnt = MyPyObjRefList->ob_refcnt - 1 ;
Py_DECREF( MyPyObjRefList ) ;
+ cdebug << "MyPyObjRefList->ob_refcnt" << MyPyObjRefList->ob_refcnt << endl ;
+ }
+ }
+ if ( ResultObj ) {
+ int cnt = ResultObj->ob_refcnt ;
+ while ( cnt > 0 ) {
+ cnt = ResultObj->ob_refcnt - 1 ;
Py_DECREF( ResultObj ) ;
- cdebug << "MyPyObjRefList->ob_refcnt" << MyPyObjRefList->ob_refcnt << " "
- << "ResultObj->ob_refcnt" << ResultObj->ob_refcnt << endl ;
+ cdebug << "ResultObj->ob_refcnt" << ResultObj->ob_refcnt << endl ;
}
}