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


C++ CompoundPtr::getData方法代码示例

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


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

示例1: processIncoming

void RSRelayMapper::processIncoming( const wns::ldk::CompoundPtr& compound )
{
    wns::ldk::ClassifierCommand* clcom =
        classifier_->getCommand( compound->getCommandPool() );

    RelayMapping mapping =
        findMapping( clcom->peer.id );
    if ( mapping == RelayMapping() )
    {
        std::stringstream ss;
        ss << "no mapping registered for CID " << clcom->peer.id;
        assure( 0, ss.str() );
    }
    wns::ldk::CommandPool* injection =
        getFUN()->getProxy()->createCommandPool();

    getFUN()->getProxy()
        ->partialCopy( this, injection, compound->getCommandPool() );

    if ( ackSwitch_
         && getFUN()->getProxy()->commandIsActivated( compound->getCommandPool(), ackSwitch_ ) )
    {
        // we need to switch the CID of the ACK too
        wimac::AckSwitchCommand* ackCom =
            ackSwitch_->getCommand( compound->getCommandPool() );
        wimac::AckSwitchCommand* injectACKCom =
            ackSwitch_->getCommand( injection );
        RelayMapping ackMapping =
            findMapping( ackCom->peer.originalCID );
        if ( ackCom->peer.originalCID == ackMapping.upperConnection_ )
            injectACKCom->peer.originalCID = ackMapping.lowerConnection_;
        else
            injectACKCom->peer.originalCID = ackMapping.upperConnection_;
    }

    wns::ldk::ClassifierCommand* injectClcom =
        classifier_->getCommand( injection );
    wns::ldk::CompoundPtr injectCompound( new wns::ldk::Compound(injection, compound->getData()));

    if ( clcom->peer.id == mapping.upperConnection_ )
    {
        LOG_INFO(getFUN()->getLayer()->getName(),
                 " maps compound CID from ", clcom->peer.id, " down to ",
                 mapping.lowerConnection_ );
        injectClcom->peer.id = mapping.lowerConnection_;


        RelayMapperCommand* rCommand =
            this->activateCommand(injectCompound->getCommandPool());
        rCommand->peer.direction_ = RelayMapperCommand::Down;

        downRelayInject_->sendData( injectCompound );
    }
    else
    {
        LOG_INFO(getFUN()->getLayer()->getName(),
                 " maps compound CID from ", clcom->peer.id, " up to ",
                 mapping.upperConnection_ );
        injectClcom->peer.id = mapping.upperConnection_;

        RelayMapperCommand* rCommand =
            this->activateCommand(injectCompound->getCommandPool());
        rCommand->peer.direction_ = RelayMapperCommand::Up;

        upRelayInject_->sendData( injectCompound );
    }
}
开发者ID:openwns,项目名称:wimac,代码行数:67,代码来源:RelayMapper.cpp


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