当前位置: 首页>>代码示例>>C++>>正文


C++ CorbaTypeTransporter::updateFromAny方法代码示例

本文整理汇总了C++中CorbaTypeTransporter::updateFromAny方法的典型用法代码示例。如果您正苦于以下问题:C++ CorbaTypeTransporter::updateFromAny方法的具体用法?C++ CorbaTypeTransporter::updateFromAny怎么用?C++ CorbaTypeTransporter::updateFromAny使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CorbaTypeTransporter的用法示例。


在下文中一共展示了CorbaTypeTransporter::updateFromAny方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: execute

    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;
        }

    }
开发者ID:pelletierts,项目名称:orocos-rtt,代码行数:30,代码来源:CorbaOperationCallerFactory.cpp

示例2: get

 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;
     }
 }
开发者ID:pelletierts,项目名称:orocos-rtt,代码行数:28,代码来源:CorbaOperationCallerFactory.cpp

示例3: string

::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 );
}
开发者ID:FynnGamadeyo,项目名称:rtt,代码行数:12,代码来源:ConfigurationInterfaceI.cpp

示例4: getPropertyDataSource

::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 );
}
开发者ID:FynnGamadeyo,项目名称:rtt,代码行数:14,代码来源:ConfigurationInterfaceI.cpp


注:本文中的CorbaTypeTransporter::updateFromAny方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。