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


C++ AccountHandler::send方法代码示例

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


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

示例1: _restartAsMaster

void AbiCollab::_restartAsMaster()
{
    UT_DEBUGMSG(("AbiCollab::_restartAsMaster()\n"));

    m_Import.masterInit();
    m_Export.masterInit();

    // the session controller will never have to revert individual changerecords,
    // so we can re-enable changerecord coalescing
    // FIXME: enable this
    //pDoc->setCoalescingMask(true);

    // inform everyone that we can restart this session
    SessionReconnectAckPacket srap(m_sId, m_pDoc->getDocUUIDString(), m_pDoc->getCRNumber());
    for (std::map<BuddyPtr, std::string>::iterator it = m_vCollaborators.begin(); it != m_vCollaborators.end(); it++)
    {
        BuddyPtr pBuddy = (*it).first;
        UT_continue_if_fail(pBuddy);

        AccountHandler* pHandler = pBuddy->getHandler();
        UT_continue_if_fail(pHandler);

        pHandler->send(&srap, pBuddy);
    }

    // we're the master now!
    m_eTakeoveState = STS_NONE;

    _pushOutgoingQueue();
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:30,代码来源:AbiCollab.cpp

示例2: push

/*!
 *	Send this packet. Note, the specified packet does still belong to the calling class.
 *	So if we want to store it (for masking), we HAVE to clone it first
 */
void AbiCollab::push(SessionPacket* pPacket)
{
    UT_DEBUGMSG(("AbiCollab::push()\n"));
    UT_return_if_fail(pPacket);

    if (m_bIsReverting)
    {
        UT_DEBUGMSG(("This packet was generated by a local revert triggerd in the import; dropping on the floor!\n"));
        return;
    }

    if (m_bExportMasked)
    {
        m_vecMaskedPackets.push_back(static_cast<SessionPacket*>(pPacket->clone())); // TODO: make this a shared ptr, so we don't need to clone the packet
        return;
    }

    if (!isLocallyControlled() && m_eTakeoveState != STS_NONE)
    {
        // TODO: revert ack packets should still go to old master
        // (or be dropped on the floor, as he probably is not even around anymore)
        UT_DEBUGMSG(("We're in the middle of a session takeover; holding on to the packet until the new master is ready"));
        m_vOutgoingQueue.push_back(static_cast<SessionPacket*>(pPacket->clone())); // TODO: make this a shared ptr, so we don't need to clone the packet
        return;
    }

    // record
    if (m_pRecorder)
        m_pRecorder->storeOutgoing( const_cast<const SessionPacket*>( pPacket ) );

    // TODO: this could go in the session manager
    UT_DEBUGMSG(("Pusing packet to %d collaborators\n", m_vCollaborators.size()));
    for (std::map<BuddyPtr, std::string>::iterator it = m_vCollaborators.begin(); it != m_vCollaborators.end(); it++)
    {
        BuddyPtr pCollaborator = (*it).first;
        UT_continue_if_fail(pCollaborator);

        UT_DEBUGMSG(("Pushing packet to collaborator with descriptor: %s\n", pCollaborator->getDescriptor(true).utf8_str()));
        AccountHandler* pHandler = pCollaborator->getHandler();
        UT_continue_if_fail(pHandler);

        // overwrite remote revision for this collaborator
        _fillRemoteRev(pPacket, pCollaborator);

        // send!
        bool res = pHandler->send(pPacket, pCollaborator);
        if (!res)
        {
            UT_DEBUGMSG(("Error sending a packet!\n"));
        }
    }
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:56,代码来源:AbiCollab.cpp


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