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


C++ unordered_multimap::erase方法代码示例

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


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

示例1: PreFullReleaseModel

void PreFullReleaseModel(int streamingIdx)
{
	int drawblDict = *(int*)0xF272E4;

	if (streamingIdx >= GetTypeStart(drawblDict) && streamingIdx <= GetTypeEnd(drawblDict))
	{
		int dict = streamingIdx - GetTypeStart(drawblDict);

		auto pair = m_dependencyDrawableDicts.equal_range(dict);

		for (auto it = pair.first; it != pair.second; it++)
		{
			if (it->second->HasInstance())
			{
				//trace("releasing dict %s (0x%08x) for a full release because *reasons*\n", GetStreamName(dict, *(int*)0xF272E4).c_str(), it->second->GetModelHash());

				it->second->RemoveInstance();
			}
		}

		//m_dependencyDrawableDicts.erase(dict);

		auto entPair = m_dependencyDictEnts.equal_range(dict);

		for (auto it = entPair.first; it != entPair.second; it++)
		{
			//trace("also destroying model for dict %s\n", GetStreamName(dict, *(int*)0xF272E4).c_str());

			it->second->DestroyModel();
		}

		m_dependencyDictEnts.erase(dict);
	}
}
开发者ID:ByModzMaster,项目名称:client,代码行数:34,代码来源:HookModelInfoParents.cpp

示例2: DrawableDictStoreGetUsageWrap

int DrawableDictStoreGetUsageWrap(int dict)
{
	int usage = DrawblDictGetUsage(dict);

	if (usage == 0 && _ReturnAddress() == (void*)0xBCC153)
	{
		bool deferred = false;

		auto pair = m_dependencyDrawableDicts.equal_range(dict);

		for (auto it = pair.first; it != pair.second; it++)
		{
			if (it->second->HasInstance())
			{
				if (!it->second->ShouldRelease())
				{
					//trace("model info for %s (0x%08x) still has %i references!\n", GetStreamName(dict, *(int*)0xF272E4).c_str(), it->second->GetModelHash(), it->second->GetRefCount());

					return 1;
				}

				it->second->RemoveInstance();

				deferred = true;
			}
		}

		//m_dependencyDrawableDicts.erase(dict);

		auto entPair = m_dependencyDictEnts.equal_range(dict);

		for (auto it = entPair.first; it != entPair.second; it++)
		{
			it->second->DestroyModel();

			deferred = true;
		}

		m_dependencyDictEnts.erase(dict);

		if (deferred)
		{
			//trace("pre-deferring drawable destruction for %s\n", GetStreamName(dict, *(int*)0xF272E4).c_str());

			DeferToNextFrame([=] ()
			{
				//trace("executing pre-deferred drawable destruction for %s\n", GetStreamName(dict, *(int*)0xF272E4).c_str());

				//ReleaseDrawblDict(dict);
				ReleaseStreamingObjectNow((void*)0xF21C60, dict + GetTypeStart(*(int*)0xF272E4));
			});

			return 1;
		}
	}

	return usage;
}
开发者ID:ByModzMaster,项目名称:client,代码行数:58,代码来源:HookModelInfoParents.cpp

示例3: findFromTextureCache

	sf::RenderTexture* ShadowTextRenderer::findFromTextureCache(sf::Vector2u size)
	{
		auto it = shadowCache.find(size);

		if (it != shadowCache.end())
		{
			auto ptr = it->second;
			shadowCache.erase(it);
			return ptr;
		}

		return 0;
	}
开发者ID:isurakka,项目名称:SnakeGame,代码行数:13,代码来源:ShadowTextRenderer.hpp


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