本文整理汇总了C++中std::unordered_multimap::insert方法的典型用法代码示例。如果您正苦于以下问题:C++ unordered_multimap::insert方法的具体用法?C++ unordered_multimap::insert怎么用?C++ unordered_multimap::insert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类std::unordered_multimap
的用法示例。
在下文中一共展示了unordered_multimap::insert方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RequestEntityModel
int RequestEntityModel(CEntity* entity)
{
auto entityExt = GetEntityExtensions()->GetAtPointer(entity);
uint16_t txd = entityExt->modelInfo->GetTxd();
uint16_t drawblDict = entityExt->modelInfo->GetDrawblDict();
assert(drawblDict != 0xFFFF);
if (txd != 0xFFFF)
{
RequestModel(txd, *(int*)0xF1CD84, 0);
}
if (drawblDict != 0xFFFF)
{
RequestModel(drawblDict, *(int*)0xF272E4, 0);
}
if (m_requestExistenceSet.find(entityExt->modelInfo) == m_requestExistenceSet.end())
{
//trace("request 0x%08x (drawable dict %s)\n", entityExt.modelInfo->GetModelHash(), GetStreamName(drawblDict, *(int*)0xF272E4).c_str());
EntityRequest req;
req.txd = txd;
req.drawblDict = drawblDict;
req.modelInfo = entityExt->modelInfo;
m_requestList.push_back(req);
m_requestExistenceSet.insert(entityExt->modelInfo);
m_dependencyDictEnts.insert(std::make_pair(drawblDict, entity));
}
return 1;
}
示例2: GetModelInfo
CBaseModelInfo* GetModelInfo(uint32_t nameHash, int* mIdx)
{
auto it = g_modelInfos.find(nameHash);
if (it == g_modelInfos.end())
{
CBaseModelInfo* info = ((CBaseModelInfo*(*)(uint32_t, int*))0x98AAE0)(nameHash, mIdx);
if (nameHash == HashRageString("parkgates_mh06"))
{
// __asm int 3
}
return info;
}
*mIdx = nameHash | 0xF0000000;
auto indIt = g_modelInfoIdxTable.find(*mIdx);
if (indIt == g_modelInfoIdxTable.end())
{
m_dependencyDrawableDicts.insert(std::make_pair(it->second->GetDrawblDict(), it->second.get()));
g_modelInfoIdxTable.insert(std::make_pair(*mIdx, it->second));
}
return it->second.get();
}
示例3: LoadDBCStores
//.........这里部分代码省略.........
LOAD_DBC(sSpellRangeStore, "SpellRange.dbc");
LOAD_DBC(sSpellRuneCostStore, "SpellRuneCost.dbc");
LOAD_DBC(sSpellShapeshiftStore, "SpellShapeshiftForm.dbc");
LOAD_DBC(sStableSlotPricesStore, "StableSlotPrices.dbc");
LOAD_DBC(sSummonPropertiesStore, "SummonProperties.dbc");
LOAD_DBC(sTalentStore, "Talent.dbc");
LOAD_DBC(sTalentTabStore, "TalentTab.dbc");
LOAD_DBC(sTaxiNodesStore, "TaxiNodes.dbc");
LOAD_DBC(sTaxiPathStore, "TaxiPath.dbc");
LOAD_DBC(sTaxiPathNodeStore, "TaxiPathNode.dbc");
LOAD_DBC(sTeamContributionPointsStore, "TeamContributionPoints.dbc");
LOAD_DBC(sTotemCategoryStore, "TotemCategory.dbc");
LOAD_DBC(sTransportAnimationStore, "TransportAnimation.dbc");
LOAD_DBC(sTransportRotationStore, "TransportRotation.dbc");
LOAD_DBC(sVehicleStore, "Vehicle.dbc");
LOAD_DBC(sVehicleSeatStore, "VehicleSeat.dbc");
LOAD_DBC(sWMOAreaTableStore, "WMOAreaTable.dbc");
LOAD_DBC(sWorldMapAreaStore, "WorldMapArea.dbc");
LOAD_DBC(sWorldMapOverlayStore, "WorldMapOverlay.dbc");
LOAD_DBC(sWorldSafeLocsStore, "WorldSafeLocs.dbc");
#undef LOAD_DBC
#define LOAD_DBC_EXT(store, file, dbtable, dbformat, dbpk) LoadDBC(availableDbcLocales, bad_dbc_files, store, dbcPath, file, dbtable, dbformat, dbpk)
LOAD_DBC_EXT(sAchievementStore, "Achievement.dbc", "achievement_dbc", CustomAchievementfmt, CustomAchievementIndex);
LOAD_DBC_EXT(sSpellStore, "Spell.dbc", "spell_dbc", CustomSpellEntryfmt, CustomSpellEntryIndex);
LOAD_DBC_EXT(sSpellDifficultyStore, "SpellDifficulty.dbc", "spelldifficulty_dbc", CustomSpellDifficultyfmt, CustomSpellDifficultyIndex);
#undef LOAD_DBC_EXT
for (CharacterFacialHairStylesEntry const* entry : sCharacterFacialHairStylesStore)
if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races
sCharFacialHairMap.insert({ entry->Race | (entry->Gender << 8) | (entry->Variation << 16), entry });
for (CharSectionsEntry const* entry : sCharSectionsStore)
if (entry->Race && ((1 << (entry->Race - 1)) & RACEMASK_ALL_PLAYABLE) != 0) // ignore nonplayable races
sCharSectionMap.insert({ entry->GenType | (entry->Gender << 8) | (entry->Race << 16), entry });
for (CharStartOutfitEntry const* outfit : sCharStartOutfitStore)
sCharStartOutfitMap[outfit->Race | (outfit->Class << 8) | (outfit->Gender << 16)] = outfit;
for (EmotesTextSoundEntry const* entry : sEmotesTextSoundStore)
sEmotesTextSoundMap[EmotesTextSoundKey(entry->EmotesTextId, entry->RaceId, entry->SexId)] = entry;
for (FactionEntry const* faction : sFactionStore)
{
if (faction->team)
{
SimpleFactionsList& flist = sFactionTeamMap[faction->team];
flist.push_back(faction->ID);
}
}
for (GameObjectDisplayInfoEntry const* info : sGameObjectDisplayInfoStore)
{
if (info->maxX < info->minX)
std::swap(*(float*)(&info->maxX), *(float*)(&info->minX));
if (info->maxY < info->minY)
std::swap(*(float*)(&info->maxY), *(float*)(&info->minY));
if (info->maxZ < info->minZ)
std::swap(*(float*)(&info->maxZ), *(float*)(&info->minZ));
}
// fill data
for (MapDifficultyEntry const* entry : sMapDifficultyStore)
示例4: register_cb_
void register_cb_(const PortStatus evt, const PortStatusCb &cb) override {
std::lock_guard<std::mutex> lock(cb_map_mutex);
// cannot use make_pair because of the reference
cb_map.insert(std::pair<unsigned int, const PortStatusCb &>(
static_cast<unsigned int>(evt), cb));
}
示例5: search_hierarchy_for_matches
void search_hierarchy_for_matches(DexMethod* bridge, DexMethod* bridgee) {
/*
* Direct reference. The only one if it's non-virtual.
*/
auto clstype = bridgee->get_class();
auto name = bridgee->get_name();
auto proto = bridgee->get_proto();
TRACE(BRIDGE, 5, " %s %s %s\n", SHOW(clstype), SHOW(name), SHOW(proto));
m_potential_bridgee_refs.emplace(MethodRef(clstype, name, proto), bridge);
if (!bridgee->is_virtual()) return;
/*
* Search super classes
*
* A bridge method in a derived class may be referred to using the name
* of a super class if a method with a matching signature is defined in
* that super class.
*
* To build the set of potential matches, we accumulate potential refs in
* maybe_refs, and when we find a matching signature in a super class, we
* add everything in maybe_refs to the set.
*/
std::vector<std::pair<MethodRef, DexMethod*>> maybe_refs;
for (auto super = type_class(type_class(clstype)->get_super_class());
super != nullptr;
super = type_class(super->get_super_class())) {
maybe_refs.emplace_back(
MethodRef(super->get_type(), name, proto), bridge);
for (auto vmethod : super->get_vmethods()) {
if (signature_matches(bridgee, vmethod)) {
for (auto DEBUG_ONLY refp : maybe_refs) {
TRACE(BRIDGE,
5,
" %s %s %s\n",
SHOW(std::get<0>(refp.first)),
SHOW(std::get<1>(refp.first)),
SHOW(std::get<2>(refp.first)));
}
m_potential_bridgee_refs.insert(maybe_refs.begin(), maybe_refs.end());
maybe_refs.clear();
}
}
}
/*
* Search sub classes
*
* Easy. Any subclass can refer to the bridgee.
*/
TypeVector subclasses;
get_all_children(clstype, subclasses);
for (auto subclass : subclasses) {
m_potential_bridgee_refs.emplace(MethodRef(subclass, name, proto),
bridge);
TRACE(BRIDGE,
5,
" %s %s %s\n",
SHOW(subclass),
SHOW(name),
SHOW(proto));
}
}
示例6: insert
void Relationships::insert(size_t src, size_t dst) {
_edges.insert({src, dst});
_vertices.insert({src, {}});
_vertices.insert({dst, {}});
}
示例7: addToTextureCache
void ShadowTextRenderer::addToTextureCache(sf::RenderTexture* tex)
{
shadowCache.insert(std::pair<sf::Vector2u, sf::RenderTexture*>(tex->getSize(), tex));
}