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


C++ AbiCollabSessionManager::beginAsyncOperation方法代码示例

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


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

示例1: initiateSessionTakeover

void AbiCollab::initiateSessionTakeover(BuddyPtr pNewMaster)
{
    UT_return_if_fail(pNewMaster);
    UT_DEBUGMSG(("AbiCollab::initiateSessionTakeover() - pNewMaster: %s\n", pNewMaster->getDescriptor(true).utf8_str()));

    AbiCollabSessionManager* pManager = AbiCollabSessionManager::getManager();
    UT_return_if_fail(pManager);

    // this could lead to us never exiting; add a timeout or something somewhere :)
    pManager->beginAsyncOperation(this);

    // NOTE: we only allow slaves in the session takeover process
    // that are on the same account as the proposed master is. The
    // others are dropped from the session. At least for now.
    // TODO: implement me

    // reset any old session takeover state
    m_bProposedController = false;
    m_pProposedController = pNewMaster;
    m_vApprovedReconnectBuddies.clear();
    m_mAckedSessionTakeoverBuddies.clear();
    m_bSessionFlushed = false;
    if (m_vOutgoingQueue.size() > 0)
        UT_ASSERT_HARMLESS(UT_SHOULD_NOT_HAPPEN);
    m_vOutgoingQueue.clear();

    // send a SessionTakeoverRequest packet to the new master
    std::vector<std::string> buddyIdentifiers;
    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);
        if (pNewMaster != pBuddy)
            buddyIdentifiers.push_back(pBuddy->getDescriptor(true).utf8_str());
    }
    SessionTakeoverRequestPacket strp_promote(m_sId, m_pDoc->getDocUUIDString(), true, buddyIdentifiers);
    pNewMaster->getHandler()->send(&strp_promote, pNewMaster);

    // send a SessionTakeoverRequest packet to the other slaves (if any)
    buddyIdentifiers.clear();
    buddyIdentifiers.push_back(pNewMaster->getDescriptor(true).utf8_str());
    SessionTakeoverRequestPacket strp_normal(m_sId, m_pDoc->getDocUUIDString(), false, buddyIdentifiers);
    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);
        if (pNewMaster != pBuddy)
            pBuddy->getHandler()->send(&strp_normal, pBuddy);
    }

    m_eTakeoveState = STS_SENT_TAKEOVER_REQUEST;
}
开发者ID:monkeyiq,项目名称:odf-2011-track-changes-git-svn,代码行数:52,代码来源:AbiCollab.cpp


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