bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object)
{
	if(find_matching_request(mQueue, object->getID()) != mQueue.end())
		return true;
	
	if(find_matching_request(mUnQueuedRequests, object->getID()) != mUnQueuedRequests.end())
		return true;
	
	return false;
}
void LLObjectMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object)
{
	// First, call parent impl.
	LLMediaDataClient::removeFromQueue(object);
	
	remove_matching_requests(mRoundRobinQueue, object->getID());
}
bool LLObjectMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object)
{
	// First, call parent impl.
	if(LLMediaDataClient::isInQueue(object))
		return true;

	if(find_matching_request(mRoundRobinQueue, object->getID()) != mRoundRobinQueue.end())
		return true;
	
	return false;
}
Ejemplo n.º 4
0
//static
LLMediaDataClient::request_ptr_t LLMediaDataClient::findOrRemove(request_queue_t &queue, const LLMediaDataClientObject::ptr_t &obj, bool remove, LLMediaDataClient::Request::Type type)
{
	request_ptr_t result;
	request_queue_t::iterator iter = queue.begin();
	request_queue_t::iterator end = queue.end();
	while (iter != end)
	{
		if (obj->getID() == (*iter)->getObject()->getID() && (type == LLMediaDataClient::Request::ANY || type == (*iter)->getType()))
		{
			result = *iter;
			if (remove) queue.erase(iter);
			break;
		}
		iter++;
	}
	return result;
}
void LLMediaDataClient::removeFromQueue(const LLMediaDataClientObject::ptr_t &object)
{
	LL_DEBUGS("LLMediaDataClient") << "removing requests matching ID " << object->getID() << LL_ENDL;
	remove_matching_requests(mQueue, object->getID());
	remove_matching_requests(mUnQueuedRequests, object->getID());
}