• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ item_map_t类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中item_map_t的典型用法代码示例。如果您正苦于以下问题:C++ item_map_t类的具体用法?C++ item_map_t怎么用?C++ item_map_t使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: 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;
        }
        LLUIImagePtr image = get_item_icon(item->getType(),
                                           item->getInventoryType(),
                                           0,
                                           item->getFlags() & LLInventoryItem::II_FLAGS_OBJECT_HAS_MULTIPLE_ITEMS);//LLUI::getUIImage(img_name);

        font->addEmbeddedChar( wch, image->getImage(), item->getName() );
    }
}
开发者ID:zwagoth,项目名称:Emerald-SVN-History,代码行数:28,代码来源:llviewertexteditor.cpp


示例2: if

// Inserts a new unique entry
BOOL LLEmbeddedItems::insertEmbeddedItem( LLInventoryItem* item, llwchar* ext_char, bool is_new)
{
	// Now insert a new one
	llwchar wc_emb;
	if (!sFreeEntries.empty())
	{
		wc_emb = sFreeEntries.top();
		sFreeEntries.pop();
	}
	else if (sEntries.empty())
	{
		wc_emb = LLTextEditor::FIRST_EMBEDDED_CHAR;
	}
	else
	{
		item_map_t::iterator last = sEntries.end();
		--last;
		wc_emb = last->first;
		if (wc_emb >= LLTextEditor::LAST_EMBEDDED_CHAR)
		{
			return FALSE;
		}
		++wc_emb;
	}

	sEntries[wc_emb].mItem = item;
	sEntries[wc_emb].mSaved = is_new ? FALSE : TRUE;
	*ext_char = wc_emb;
	mEmbeddedUsedChars.insert(wc_emb);
	return TRUE;
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:32,代码来源:llviewertexteditor.cpp


示例3: print

 virtual void print() const{
     printf("%s: \"%s\"\n", _name.c_str(), _description.c_str());
     item_map_t::const_iterator iter = _item_map.begin();
     for(; iter != _item_map.end(); ++ iter){
         printf("\t");
         iter->second.print();
     }
 }
开发者ID:MIPS,项目名称:karma,代码行数:8,代码来源:statistics.hpp


示例4: 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;
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:13,代码来源:llviewertexteditor.cpp


示例5: 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;
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:13,代码来源:llviewertexteditor.cpp


示例6: 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;
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:13,代码来源:llviewertexteditor.cpp


示例7: 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();
 }
开发者ID:MIPS,项目名称:karma,代码行数:18,代码来源:statistics.hpp


示例8: strcpy

void item::remove() {
    //Remove the entry in map that points to current tuple
    item_map_t::iterator item_map_iter;
    item_map_iter=item_map.find(make_tuple(i_id));
    item_map.erase(item_map_iter);
    //Move last tuple in vector in the place of the deleted tuple
    //If current tuple is not the last tuple,
    if(tuple_id != count - 1) {

        //Move content of last tuple to fields in this tuple
        item item_vect_last_iter;
        item_vect_last_iter=item_vect.at(count - 1);

        i_id = item_vect_last_iter.i_id;
        i_im_id = item_vect_last_iter.i_im_id;
        strcpy(i_name, item_vect_last_iter.i_name);
        i_price = item_vect_last_iter.i_price;
        strcpy(i_data, item_vect_last_iter.i_data);

        //Remove the entry for the last tuple in map, and insert a new one with new tuple_id
        item_map_t::iterator item_map_iter;
        item_map_iter=item_map.find(make_tuple(i_id));
        if(item_map_iter != item_map.end())
            item_map.erase(item_map_iter);
        item_map.insert(make_pair(make_tuple(i_id), tuple_id));;

        //Call remove on the last entry of the vector
        item_vect_last_iter.remove();
    }
    else {		//if the tuple is the last tuple in the vector
        count--;
        item_vect.pop_back();
    }
    //item_vect.erase(tuple_id);
}
开发者ID:gkernel,项目名称:db-assignment,代码行数:35,代码来源:storage.cpp


示例9: 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() );
	}
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:70,代码来源:llviewertexteditor.cpp


示例10: flush

 virtual void flush(){
     item_map_t::iterator iter = _item_map.begin();
     for(; iter != _item_map.end(); ++iter) iter->second.flush();
 }
开发者ID:MIPS,项目名称:karma,代码行数:4,代码来源:statistics.hpp


示例11: unbindEmbeddedChars

void LLEmbeddedItems::unbindEmbeddedChars( const LLFontGL* font ) const
{
	if( sEntries.empty() )
	{
		return; 
	}

	for (std::set<llwchar>::const_iterator iter1 = mEmbeddedUsedChars.begin(); iter1 != mEmbeddedUsedChars.end(); ++iter1)
	{
		font->removeEmbeddedChar(*iter1);
	}
}
开发者ID:Ratany,项目名称:SingularityViewer,代码行数:12,代码来源:llviewertexteditor.cpp


示例12: insert

void item::insert() {
    tuple_id = count;
    item_vect.push_back(*this);
    item_map.insert(make_pair(make_tuple(i_id), count));
    count++;
}
开发者ID:gkernel,项目名称:db-assignment,代码行数:6,代码来源:storage.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ item_t类代码示例发布时间:2022-05-31
下一篇:
C++ item_location类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap