}
else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) {
double d = l ;
- *theValue <<= d ;
+ theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ //*theValue <<= d ;
*theValue >>= d ;
+
#if ValueTrace
cdebug << " --> Value( " << d << ") (double) kind " << theValue->type()->kind() ;
#endif
<< theValue->type()->kind() ;
#endif
}
- _theValue = theValue ;
- *_Value = theValue ;
+
+ //_theValue = theValue ;
+ _theValue = new CORBA::Any( *theValue ) ;
+
+ //*_Value = theValue ;
+ _Value = &_theValue ;
+
//JR 21.02.2005 Debug Memory leak :
delete aDataValue ;
}
cdebug << "Value( " << d << ") (double)";
#endif
if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) { // SuperVision Value
- _theValue = aDataValue ;
- *_Value = aDataValue ;
+ //_theValue = aDataValue ;
+ _theValue = new CORBA::Any( *aDataValue ) ;
+
+ //*_Value = aDataValue ;
+ _Value = &_theValue ;
+
*_theValue >>= d;
#if ValueTrace
cdebug << " == Value( " << d << ") (double)";
<< theValue->type()->kind() ;
#endif
}
- _theValue = theValue ;
- *_Value = theValue ;
+ //_theValue = theValue ;
+ _theValue = new CORBA::Any( *theValue ) ;
+
+ //*_Value = theValue ;
+ _Value = &_theValue ;
+
//JR 21.02.2005 Debug Memory leak :
delete aDataValue ;
}
}
else if ( !strcmp( Type , "float" ) || !strcmp( Type , "double" ) ) {
double d = (double ) 0. ;
- *theValue <<= d ;
+ theValue->replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ //*theValue <<= d ;
*theValue >>= d;
#if ValueTrace
cdebug << " --> Value( " << d << ") (double) kind " << theValue->type()->kind() ;
#endif
}
- _theValue = theValue ;
- *_Value = theValue ;
+ //_theValue = theValue ;
+ _theValue = new CORBA::Any( *theValue ) ;
+
+ //*_Value = theValue ;
+ _Value = &_theValue ;
+
//JR 21.02.2005 Debug Memory leak :
delete aDataValue ;
}
#if SendEventTrace
cdebug << pthread_self() << "/" << ThreadNo() << " SendedEvent Node " << Name()
<< " will exit : a node was aborted ..." << endl ;
- State( _NextState ) ;
#endif
+ State( _NextState ) ;
+ sts = false;
}
else {
sts = executeAction() ;
}
int GraphExecutor::InNode::executeAction() {
+
int oldRewindStack = ( _RewindStack > MAXSTACKTHREADSIZE ) ;
if ( !CreateNewThread() && oldRewindStack ) {
#if ActionsTrace
nOutParams = GetNodeOutPortsSize() ;
OutParametersList = new ServicesAnyData[nOutParams];
InOutParametersSet( nOutParams , OutParametersList ) ;
+
#if 0
if ( !Err && IsComputingNode() ) {
cdebug << ThreadNo() << " DataReady_ExecuteAction " << Name() << " "
InLineNode()->PyFuncName() ,
InParametersList , ServiceInParameter().length() ,
OutParametersList , ServiceOutParameter().length() ) ;
+
if ( !StsPyDynInvoke ) {
string anErrorMessage = string( "Dynamic Python call for node " ) +
string( Name() ) + " function " +
<< InLineNode()->PyFuncName()
<< "' IsGOTONode PyDynInvoke" << endl ;
#endif
+
StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
InLineNode()->PyFuncName() ,
InParametersList , ServiceInParameter().length() ,
OutParametersList , ServiceOutParameter().length() ) ;
+
if ( !StsPyDynInvoke ) {
string anErrorMessage = string( "Dynamic Python call for node " ) +
string( Name() ) + " function " +
<< InLineNode()->PyFuncName()
<< "' IsSwitchNode PyDynInvoke" << endl ;
#endif
+
StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
InLineNode()->PyFuncName() ,
InParametersList , ServiceInParameter().length() ,
OutParametersList , ServiceOutParameter().length() ) ;
+
if ( !StsPyDynInvoke ) {
string anErrorMessage = string( "Dynamic Python call for node " ) +
string( Name() ) + " function " +
<< InLineNode()->PyFuncName()
<< "' IsSwitchNode PyDynInvoke" << endl ;
#endif
+
StsPyDynInvoke = PyDynInvoke( InLineNode()->PyRunMethod() ,
InLineNode()->PyFuncName() ,
InParametersList , ServiceInParameter().length() + 1 ,
OutParametersList , ServiceOutParameter().length() + 1 ) ;
+
if ( !StsPyDynInvoke ) {
string anErrorMessage = string( "Dynamic Python call for node " ) +
string( Name() ) + " function " +
else {
for ( i = 0 ; i < (int ) ServiceInParameter().length() ; i++ ) {
OutParametersList[argout0 + i].Value = InParametersList[argin0 + i].Value ;
+
#if TraceDataReady_ExecuteAction
cdebug << "ArgOut->In" << InParametersList[argin0 + i].Name.c_str()
<< " " << AnyValue( InParametersList[argin0 + i].Value )
double d ;
sscanf( t , "%lf" , &d ) ;
float f = d ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
#if InParametersSetTrace
cdebug << "string '" << t << "' --> " << setw(25) << setprecision(18) << d << " --> float " << " = "
<< setw(25) << setprecision(18) << f ;
else if ( !strcmp( Type , "double" ) ) {
double d ;
sscanf( t , "%lf" , &d ) ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
#if InParametersSetTrace
cdebug << "string '" << t << " --> double " << setw(25) << setprecision(18) << d ;
#endif
else if ( !strcmp( Type , "float" ) ) {
float f ;
f = (float ) l ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
// theOutPort->Value( D.Value ) ;
}
else if ( !strcmp( Type , "double" ) ) {
double d ;
d = (double ) l ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
// theOutPort->Value( D.Value ) ;
}
// else if ( !strcmp( Type , "objref" ) ) {
else if ( !strcmp( Type , "float" ) ) {
float f ;
f = (float ) d ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
// theOutPort->Value( D.Value ) ;
}
else if ( !strcmp( Type , "double" ) ) {
}
else if ( !strcmp( Type , "float" ) ) {
float f = 0 ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
// theOutPort->Value( D.Value ) ;
}
else if ( !strcmp( Type , "double" ) ) {
double d = 0 ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
// theOutPort->Value( D.Value ) ;
}
// else if ( !strcmp( Type , "objref" ) ) {
}
else if ( !strcmp( Type , "float" ) ) {
float f = 0 ;
- D.Value <<= f ;
+ D.Value.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+// D.Value <<= f ;
}
else if ( !strcmp( Type , "double" ) ) {
double d = 0 ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
}
else {
D.Value <<= CORBA::Object::_nil() ;
float f;
D.Value >>= f;
double d = (double ) f ;
- D.Value <<= d ;
+ D.Value.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+// D.Value <<= d ;
#if OutParametersSetTrace
cdebug << ThreadNo() << " " << f << "(float)" << endl ;
#endif
ArgValue = Py_BuildValue( "O" , ResultObj ) ;
PyTuple_SetItem( ArgsList , i , ArgValue ) ;
#if PyDynInvokeTrace
- cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt"
- << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
+ if ( ArgValue )
+ cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt"
+ << ArgsList->ob_refcnt << " ArgValue->ob_refcnt" << ArgValue->ob_refcnt << endl ;
+ else
+ cdebug << "ArgIn" << i << " : " << sname << " " << method << " Value (objref) ArgsList->ob_refcnt"
+ << ArgsList->ob_refcnt << " ArgValue is NULL" << endl ;
cdebug << "MyPyObjRefList->ob_refcnt " << MyPyObjRefList->ob_refcnt-1 << endl ;
#endif
Py_DECREF( MyPyObjRefList ) ;
}
else {
#if PyDynInvokeTrace
- cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
+ if ( ResultObj )
+ cdebug << "ResultObj->ob_refcnt " << ResultObj->ob_refcnt-1 << endl ;
+ else
+ cdebug << "ResultObj is NULL" << endl ;
#endif
- Py_DECREF( ResultObj ) ;
+ if ( ResultObj )
+ Py_DECREF( ResultObj ) ;
}
break ;
}
else {
f = PyFloat_AsDouble( ArgValue ) ;
}
- data <<= f ;
+ data.replace(CORBA::TypeCode::PR_float_tc(), (void*)(&f));
+ //data <<= f ;
#if PyDynInvokeTrace
cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << f << " (float)"
<< " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"
else {
d = PyFloat_AsDouble( ArgValue ) ;
}
- data <<= d ;
+ data.replace(CORBA::TypeCode::PR_double_tc(), (void*)(&d));
+ //data <<= d ;
#if PyDynInvokeTrace
cdebug << "ArgOut" << i << " : " << sname << " " << method << " Value " << d << " (double)"
<< " Result->ob_refcnt" << Result->ob_refcnt << " ArgValue->ob_refcnt"