本文整理汇总了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;
}