本文整理汇总了C++中item_map_t::find方法的典型用法代码示例。如果您正苦于以下问题:C++ item_map_t::find方法的具体用法?C++ item_map_t::find怎么用?C++ item_map_t::find使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类item_map_t
的用法示例。
在下文中一共展示了item_map_t::find方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getEmbeddedItemSaved
// static
BOOL LLEmbeddedItems::getEmbeddedItemSaved(llwchar ext_char)
{
if( ext_char >= LLTextEditor::FIRST_EMBEDDED_CHAR && ext_char <= LLTextEditor::LAST_EMBEDDED_CHAR )
{
item_map_t::iterator iter = sEntries.find(ext_char);
if (iter != sEntries.end())
{
return iter->second.mSaved;
}
}
return FALSE;
}
示例2: removeEmbeddedItem
// Removes an entry (all entries are unique)
BOOL LLEmbeddedItems::removeEmbeddedItem( llwchar ext_char )
{
mEmbeddedUsedChars.erase(ext_char);
item_map_t::iterator iter = sEntries.find(ext_char);
if (iter != sEntries.end())
{
sEntries.erase(ext_char);
sFreeEntries.push(ext_char);
return TRUE;
}
return FALSE;
}
示例3: getEmbeddedItem
// static
LLInventoryItem* LLEmbeddedItems::getEmbeddedItem(llwchar ext_char)
{
if( ext_char >= LLTextEditor::FIRST_EMBEDDED_CHAR && ext_char <= LLTextEditor::LAST_EMBEDDED_CHAR )
{
item_map_t::iterator iter = sEntries.find(ext_char);
if (iter != sEntries.end())
{
return iter->second.mItem;
}
}
return NULL;
}
示例4: addMeasurement
void addMeasurement(const l4_uint32_t id, l4_uint64_t value){
GET_STATS.enterMeasurement();
_item_map_mutex.enter();
item_map_t::iterator iter = _item_map.find(id);
_item_map_mutex.leave();
if(iter != _item_map.end()){
iter->second.addMeasurement(value);
} else {
_item_map_mutex.enter();
Item & item = _item_map[id];
_item_map_mutex.leave();
item.addMeasurement(value);
std::stringstream s;
s << "0x" << std::hex << id;
item.setName(s.str());
}
GET_STATS.leaveMeasurement();
}
示例5: bindEmbeddedChars
void LLEmbeddedItems::bindEmbeddedChars( const LLFontGL* font ) const
{
if( sEntries.empty() )
{
return;
}
for (std::set<llwchar>::const_iterator iter1 = mEmbeddedUsedChars.begin(); iter1 != mEmbeddedUsedChars.end(); ++iter1)
{
llwchar wch = *iter1;
item_map_t::iterator iter2 = sEntries.find(wch);
if (iter2 == sEntries.end())
{
continue;
}
LLInventoryItem* item = iter2->second.mItem;
if (!item)
{
continue;
}
const char* img_name;
switch( item->getType() )
{
case LLAssetType::AT_TEXTURE:
if(item->getInventoryType() == LLInventoryType::IT_SNAPSHOT)
{
img_name = "inv_item_snapshot.tga";
}
else
{
img_name = "inv_item_texture.tga";
}
break;
case LLAssetType::AT_SOUND: img_name = "inv_item_sound.tga"; break;
case LLAssetType::AT_CALLINGCARD: img_name = "inv_item_callingcard_online.tga"; break;
case LLAssetType::AT_LANDMARK:
if (item->getFlags() & LLInventoryItemFlags::II_FLAGS_LANDMARK_VISITED)
{
img_name = "inv_item_landmark_visited.tga";
}
else
{
img_name = "inv_item_landmark.tga";
}
break;
case LLAssetType::AT_CLOTHING: img_name = "inv_item_clothing.tga"; break;
case LLAssetType::AT_OBJECT:
if (item->getFlags() & LLInventoryItemFlags::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS)
{
img_name = "inv_item_object_multi.tga";
}
else
{
img_name = "inv_item_object.tga";
}
break;
case LLAssetType::AT_NOTECARD: img_name = "inv_item_notecard.tga"; break;
case LLAssetType::AT_LSL_TEXT: img_name = "inv_item_script.tga"; break;
case LLAssetType::AT_BODYPART: img_name = "inv_item_skin.tga"; break;
case LLAssetType::AT_ANIMATION: img_name = "inv_item_animation.tga";break;
case LLAssetType::AT_GESTURE: img_name = "inv_item_gesture.tga"; break;
default: llassert(0); continue;
}
LLUIImagePtr image = LLUI::getUIImage(img_name);
font->addEmbeddedChar( wch, image->getImage(), item->getName() );
}
}