本文整理汇总了C++中QueueItemPtr::removeDownloads方法的典型用法代码示例。如果您正苦于以下问题:C++ QueueItemPtr::removeDownloads方法的具体用法?C++ QueueItemPtr::removeDownloads怎么用?C++ QueueItemPtr::removeDownloads使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QueueItemPtr
的用法示例。
在下文中一共展示了QueueItemPtr::removeDownloads方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeQI
void UserQueue::removeQI(QueueItemPtr& qi, const UserPtr& aUser, bool removeRunning /*true*/, bool addBad /*false*/, bool fireSources /*false*/) {
if(removeRunning) {
qi->removeDownloads(aUser);
}
dcassert(qi->isSource(aUser));
BundlePtr bundle = qi->getBundle();
if (bundle) {
if (!bundle->isSource(aUser)) {
return;
}
if (qi->getBundle()->removeUserQueue(qi, aUser, addBad)) {
removeBundle(bundle, aUser);
if (fireSources) {
QueueManager::getInstance()->fire(QueueManagerListener::BundleSources(), bundle);
}
} else {
dcassert(userBundleQueue.find(aUser) != userBundleQueue.end());
}
}
if (qi->getPriority() == QueueItem::HIGHEST) {
auto j = userPrioQueue.find(aUser);
dcassert(j != userPrioQueue.end());
if (j == userPrioQueue.end()) {
return;
}
auto& l = j->second;
auto i = find(l.begin(), l.end(), qi);
dcassert(i != l.end());
if (i == l.end()) {
return;
}
l.erase(i);
if(l.empty()) {
userPrioQueue.erase(j);
}
}
}
示例2: removeQI
void UserQueue::removeQI(QueueItemPtr& qi, const UserPtr& aUser, bool removeRunning /*true*/, Flags::MaskType reason) noexcept{
if(removeRunning) {
qi->removeDownloads(aUser);
}
dcassert(qi->isSource(aUser));
BundlePtr bundle = qi->getBundle();
if (bundle) {
if (!bundle->isSource(aUser)) {
return;
}
aUser->removeQueued(qi->getSize());
if (qi->getBundle()->removeUserQueue(qi, aUser, reason)) {
removeBundle(bundle, aUser);
} else {
dcassert(userBundleQueue.find(aUser) != userBundleQueue.end());
}
}
if (qi->getPriority() == QueueItem::HIGHEST) {
auto j = userPrioQueue.find(aUser);
dcassert(j != userPrioQueue.end());
if (j == userPrioQueue.end()) {
return;
}
auto& l = j->second;
auto i = find(l.begin(), l.end(), qi);
dcassert(i != l.end());
if (i == l.end()) {
return;
}
l.erase(i);
if(l.empty()) {
userPrioQueue.erase(j);
}
}
}