bool execute() { try { if (mdocall) { CORBA::Any_var any = mfact->callOperation( mop.c_str(), nargs.inout() ); for (size_t i=0; i < margs.size(); ++i ) { const types::TypeInfo* ti = margs[i]->getTypeInfo(); CorbaTypeTransporter* ctt = dynamic_cast<CorbaTypeTransporter*>( ti->getProtocol(ORO_CORBA_PROTOCOL_ID) ); assert( ctt ); ctt->updateFromAny( &nargs[i], margs[i] ); } // convert returned any to local type: if (mctt) return mctt->updateFromAny(&any.in(), mresult); } else { CSendHandle_var sh = mfact->sendOperation( mop.c_str(), nargs.in() ); AssignableDataSource<CSendHandle_var>::shared_ptr ads = AssignableDataSource<CSendHandle_var>::narrow( mresult.get() ); if (ads) { ads->set( sh ); // _var creates a copy of the obj reference. } } return true; } catch ( corba::CNoSuchNameException& ) { return false; } catch ( corba::CWrongNumbArgException& ) { return false; } catch ( corba::CWrongTypeArgException& ) { return false; } }
SendStatus get() const { try { // only try to collect if we didn't do so before: if ( mss != SendSuccess ) { corba::CAnyArguments_var nargs; if ( misblocking->get() ) { mss = SendStatus( static_cast<int>(msh->collect( nargs.out() ) ) - 1 ); } else { mss = SendStatus( static_cast<int>(msh->collectIfDone( nargs.out() ) ) - 1 ); } // only convert results when we got a success: if (mss == SendSuccess) { assert( nargs->length() == margs.size() ); for (size_t i=0; i < margs.size(); ++i ) { const types::TypeInfo* ti = margs[i]->getTypeInfo(); CorbaTypeTransporter* ctt = dynamic_cast<CorbaTypeTransporter*>( ti->getProtocol(ORO_CORBA_PROTOCOL_ID) ); assert( ctt ); ctt->updateFromAny( &nargs[i], margs[i] ); } } } return mss; } catch ( corba::CWrongNumbArgException& ) { return mss; } catch ( corba::CWrongTypeArgException& ) { return mss; } }
::CORBA::Boolean RTT_corba_CConfigurationInterface_i::setAttribute ( const char * name, const ::CORBA::Any & value) { if ( !mar || !mar->hasAttribute( string(name) ) ) return 0; DataSourceBase::shared_ptr ds = mar->getValue( string(name) )->getDataSource(); const TypeInfo* ti = ds->getTypeInfo(); CorbaTypeTransporter* ctt = dynamic_cast<CorbaTypeTransporter*>( ti->getProtocol(ORO_CORBA_PROTOCOL_ID) ); assert( ctt ); return ctt->updateFromAny( &value, ds ); }
::CORBA::Boolean RTT_corba_CConfigurationInterface_i::setProperty ( const char * name, const ::CORBA::Any & value) { if (mar) mbag = mar->properties(); // leave this here to get latest propertybag. DataSourceBase::shared_ptr ds = getPropertyDataSource(name); if ( !ds ) return 0; const TypeInfo* ti = ds->getTypeInfo(); CorbaTypeTransporter* ctt = dynamic_cast<CorbaTypeTransporter*>( ti->getProtocol(ORO_CORBA_PROTOCOL_ID) ); assert( ctt ); return ctt->updateFromAny( &value, ds ); }