From 6cd64917c1cee74adb1538ca2076f773aaa23d01 Mon Sep 17 00:00:00 2001 From: rahuel Date: Fri, 14 Oct 2005 11:44:50 +0000 Subject: [PATCH] Porting from omniORB3 to omniORB4 --- src/GraphBase/DataFlowBase_DataPort.cxx | 32 +++++++++++++++++++ .../DataFlowExecutor_PyDynInvoke.cxx | 4 +++ src/Supervision/Value_Impl.cxx | 4 +++ 3 files changed, 40 insertions(+) diff --git a/src/GraphBase/DataFlowBase_DataPort.cxx b/src/GraphBase/DataFlowBase_DataPort.cxx index 0496832..e260801 100644 --- a/src/GraphBase/DataFlowBase_DataPort.cxx +++ b/src/GraphBase/DataFlowBase_DataPort.cxx @@ -166,7 +166,11 @@ void GraphBase::DataPort::Value( const CORBA::Any * aDataValue ) { catch( ... ) { *theValue <<= CORBA::Object::_nil() ; } +#if OMNIORB_VERSION >= 4 + *theValue >>= (CORBA::Any::to_object ) ObjRef ; +#else *theValue >>= ObjRef ; +#endif cdebug << " --> Value( " << ObjectToString( ObjRef ) << ") (object reference) kind " << theValue->type()->kind() ; } @@ -205,7 +209,11 @@ void GraphBase::DataPort::Value( const CORBA::Any * aDataValue ) { else { // Default CORBA::Object_ptr ObjRef ; *theValue <<= CORBA::Object::_nil() ; +#if OMNIORB_VERSION >= 4 + *theValue >>= (CORBA::Any::to_object ) ObjRef ; +#else *theValue >>= ObjRef ; +#endif cdebug << " --> Value( " << ObjectToString( ObjRef ) << ") (object reference) kind " << theValue->type()->kind() ; } @@ -244,7 +252,11 @@ void GraphBase::DataPort::Value( const CORBA::Any * aDataValue ) { else { // Default CORBA::Object_ptr ObjRef ; *theValue <<= CORBA::Object::_nil() ; +#if OMNIORB_VERSION >= 4 + *theValue >>= (CORBA::Any::to_object ) ObjRef ; +#else *theValue >>= ObjRef ; +#endif cdebug << " --> Value( " << ObjectToString( ObjRef ) << ") (object reference) kind " << theValue->type()->kind() ; } @@ -255,7 +267,11 @@ void GraphBase::DataPort::Value( const CORBA::Any * aDataValue ) { } case CORBA::tk_objref: { // Input objref Value CORBA::Object_ptr obj ; +#if OMNIORB_VERSION >= 4 + *aDataValue >>= (CORBA::Any::to_object ) obj; +#else *aDataValue >>= obj; +#endif cdebug << "Value( " << ObjectToString( obj ) << ") (object reference)"; if ( strcmp( Type , "string" ) && strcmp( Type , "boolean" ) && strcmp( Type , "char" ) && @@ -263,14 +279,22 @@ void GraphBase::DataPort::Value( const CORBA::Any * aDataValue ) { strcmp( Type , "double" ) ) { // SuperVision Default Value _theValue = aDataValue ; *_Value = aDataValue ; +#if OMNIORB_VERSION >= 4 + *_theValue >>= (CORBA::Any::to_object ) obj ; +#else *_theValue >>= obj; +#endif cdebug << " == Value( " << ObjectToString( obj ) << ") (object reference)"; } else { CORBA::Any * theValue = new CORBA::Any() ; if ( !strcmp( Type , "string" ) ) { *theValue <<= ObjectToString( obj ) ; +#if OMNIORB_VERSION >= 4 + *theValue >>= (CORBA::Any::to_object ) obj ; +#else *theValue >>= obj ; +#endif cdebug << " --> Value( " << ObjectToString( obj ) << ") (string) kind " << theValue->type()->kind() ; } else if ( !strcmp( Type , "boolean" ) || !strcmp( Type , "char" ) || @@ -386,7 +410,11 @@ CORBA::Any const * GraphBase::DataPort::Value() const { CORBA::Object_ptr obj ; char * retstr ; try { +#if OMNIORB_VERSION >= 4 + *theValue >>= (CORBA::Any::to_object ) obj ; +#else *theValue >>= obj ; +#endif retstr = ObjectToString( obj ); // cdebug << "GraphBase::DataPort::Value() : " << retstr // << "(object reference) " << endl; @@ -480,7 +508,11 @@ void GraphBase::DataPort::StringValue(ostream & f ) const { case CORBA::tk_objref: CORBA::Object_ptr ObjRef ; try { +#if OMNIORB_VERSION >= 4 + *theValue >>= (CORBA::Any::to_object ) ObjRef ; +#else *theValue >>= ObjRef ; +#endif f << "(object reference) " << ObjectToString( ObjRef ) ; } catch(...) { diff --git a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx index 6dcdb43..1a6825f 100644 --- a/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx +++ b/src/GraphExecutor/DataFlowExecutor_PyDynInvoke.cxx @@ -356,7 +356,11 @@ bool GraphExecutor::InNode::PyDynInvoke( PyObject * MyPyRunMethod , case CORBA::tk_objref : { MyPyObjRefList = PyTuple_New( 1 ) ; PyObject * ObjValue ; +#if OMNIORB_VERSION >= 4 + data >>= (CORBA::Any::to_object ) ObjRef ; +#else data >>= ObjRef ; +#endif IORObjRef = ObjectToString( ObjRef ) ; ObjValue = Py_BuildValue( "s" , IORObjRef ) ; PyTuple_SetItem( MyPyObjRefList , 0 , ObjValue ) ; diff --git a/src/Supervision/Value_Impl.cxx b/src/Supervision/Value_Impl.cxx index 9b948e6..f04d3a8 100644 --- a/src/Supervision/Value_Impl.cxx +++ b/src/Supervision/Value_Impl.cxx @@ -278,7 +278,11 @@ char * Value_Impl::ToString() { case CORBA::tk_objref: { CORBA::Object_ptr obj ; try { +#if OMNIORB_VERSION >= 4 + anAny >>= (CORBA::Any::to_object ) obj ; +#else anAny >>= obj ; +#endif retstr = _Orb->object_to_string( obj ); // MESSAGE( "ToString( object ) '" << retstr << "'" ); } -- 2.39.2