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


C++ EntryList::push_back方法代码示例

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


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

示例1: append_result

 virtual void append_result(CaliperMetadataDB& db, EntryList& list) {
     if (m_count > 0) {
         list.push_back(Entry(m_config->get_avg_attribute(db),
                              m_sum.to_double() / m_count));
         list.push_back(Entry(m_config->get_min_attribute(db), m_min));
         list.push_back(Entry(m_config->get_max_attribute(db), m_max));
     }
 }
开发者ID:LLNL,项目名称:Caliper,代码行数:8,代码来源:Aggregator.cpp

示例2: list_entries

// compare this to Table::list_entries(), which uses the underlying map.
// Class keeps an explicit list of entries so it can deliver entries
// in _order of declaration_.  No doubt there is more than one way to
// do this
void Class::list_entries(EntryList &el, int flags)
{
    if ((flags & DO_PARENT) && base_class() != NULL) base_class()->list_entries(el,flags);
    EntryList::iterator eli;
    for(eli = m_entries.begin(); eli != m_entries.end(); ++eli)
        if (check_entry(*eli,flags)) el.push_back(*eli);
}
开发者ID:doniexun,项目名称:UnderC,代码行数:11,代码来源:class.cpp

示例3: add_entry

/*
 * Add new key/value, but first check
 * do we alread have and key, so if
 * we do, just update value
 */
void ConfigSection::add_entry(const char* key, const char* value) {
	E_ASSERT(key != NULL);
	E_ASSERT(value != NULL);

	ConfigEntry* e = find_entry(key);
	if (!e) {
		e = new ConfigEntry;
		e->keylen = strlen(key);
		e->valuelen = strlen(value);
		e->key = strdup(key);
		e->value = strdup(value);
		// hash the key
		e->hash = do_hash(e->key, e->keylen);

		E_ASSERT(e->key != NULL);
		E_ASSERT(e->value != NULL);
#ifdef CONFIG_INTERNAL
		printf("Adding: |%s| = |%s| hash = %i section = %s\n", e->key, e->value, e->hash, sname);
#endif
		entry_list.push_back(e);
	} else {
#ifdef CONFIG_INTERNAL
		printf("!!! found duplicate for %s\n", e->key);
#endif
		free(e->value);
		e->valuelen = strlen(value);
		e->value = strdup(value);
		E_ASSERT(e->value != NULL);
	}
}
开发者ID:edeproject,项目名称:svn,代码行数:35,代码来源:Config.cpp

示例4: add_entry

/*
 * Add new key/value, but first check
 * do we alread have and key, so if
 * we do, just update value
 */
void ConfigSection::add_entry(const char* key, const char* value) {
	E_ASSERT(key != NULL);
	E_ASSERT(value != NULL);

	ConfigEntry* e = find_entry(key);
	if (!e) {
		e = new ConfigEntry;
		e->keylen   = strlen(key);
		e->valuelen = strlen(value);
		e->key      = strdup(key);
		e->value    = strdup(value);
		e->hash     = do_hash(e->key, e->keylen);

		E_ASSERT(e->key != NULL);
		E_ASSERT(e->value != NULL);

		entry_list.push_back(e);
	} else {
		free(e->value);
		e->valuelen = strlen(value);
		e->value    = strdup(value);

		E_ASSERT(e->value != NULL);
	}
}
开发者ID:edeproject,项目名称:svn,代码行数:30,代码来源:Config.cpp

示例5: DeserializeList

bool YumemiArchive_Base::DeserializeList(std::istream &is, uint32_t list_count, uint32_t filesize, EntryList &list)
{
  for(uint16_t i = 0; i < list_count; ++i) {
    Entry entry;
    uint16_t magic;
    char     padding[8];
    is.read((char *)&magic, 2);
    if(is.fail()) return false;
    is.read((char *)&entry.key, 1);
    if(is.fail()) return false;
    is.read(entry.name, 13);
    if(is.fail()) return false;
    is.read((char *)&entry.compsize, 2);
    if(is.fail()) return false;
    is.read((char *)&entry.origsize, 2);
    if(is.fail()) return false;
    is.read((char *)&entry.offset, 4);
    if(is.fail()) return false;
    is.read(padding, 8);
    if(is.fail()) return false;

    if(magic == 0) break;

    if(magic != 0x9595 && magic != 0xF388) return false;
    if(entry.offset >= filesize) return false;
    if((uint32_t)filesize - entry.offset < entry.compsize) return false;
    if(!ValidateName(entry.name)) return false;
    list.push_back(entry);
  }
  return true;
}
开发者ID:CodeGuro,项目名称:THE,代码行数:31,代码来源:yumemi.cpp

示例6: parseExpressionListPrime

void Parser::parseExpressionListPrime(EntryList& expList){
	if(isNext(tc_COMMA)){
		match(tc_COMMA);
		expList.push_back(parseExpression());
		parseExpressionListPrime(expList);
	}
}
开发者ID:nicolai490,项目名称:---endur,代码行数:7,代码来源:parser.cpp

示例7: parseExpressionList

void Parser::parseExpressionList(SymbolTableEntry* prevEntry){
	EntryList expList = *(new EntryList());
	//expList.push_back(prevEntry);
	expList.push_back(parseExpression());
	parseExpressionListPrime(expList);
	m_code->generateCall(prevEntry, expList);
}
开发者ID:nicolai490,项目名称:---endur,代码行数:7,代码来源:parser.cpp

示例8: loadIncreament

bool BuddyCoreSnapshotI::loadIncreament() {
	multimap<int, SnapshotEntrySeqMap> incs;
	{
		IceUtil::Mutex::Lock lock(_increamentsMutex);
		if (_increaments.empty()) {
			MCE_DEBUG("Increaments is empty.");
			return false;
		}
		incs.swap(_increaments);
	}
	int usersize4log = 0;
	for (multimap<int, SnapshotEntrySeqMap>::iterator it = incs.begin(); it
			!= incs.end(); ++it) {
		SnapshotEntrySeqMap smaps = it -> second;
		usersize4log += smaps.size();
		for (SnapshotEntrySeqMap::iterator smapsIt = smaps.begin(); smapsIt
				!= smaps.end(); ++smapsIt) {
			int userId = smapsIt -> first;
			EntryList el;
			for (SnapshotEntrySeq::iterator sentryIt = smapsIt->second.begin(); sentryIt
					!= smapsIt->second.end(); ++sentryIt) {
				SnapshotEntry entry = *sentryIt;
				switch (entry.desc) {
				case Friend:
					el.push_back(Entry(entry.toId, DESC_FRIEND));
					break;
				case Apply:
					el.push_back(Entry(entry.toId, DESC_APPLY));
					break;
				case Block:
					el.push_back(Entry(entry.toId, DESC_BLOCK));
					break;
				default:
					continue;
					break;
				}
			}
			ServiceI::instance().addObject(new EntryListHolder(userId, el), CATEGORY_ENTRY, userId);
			MCE_DEBUG("loadIncreament for id="<<userId<<" done");
		}
	}
	MCE_INFO("loadIncreament for "<<usersize4log<<" users in "<<incs.size()
			<<" batches. done.");
	return true;
}
开发者ID:bradenwu,项目名称:oce,代码行数:45,代码来源:BuddyCoreSnapshotI.cpp

示例9: unpack_key

    void unpack_key(const unsigned char* key, const CaliperMetadataDB& db, EntryList& list) {
        // key format: 2*N + node flag, node id, N * (attr id, Variant)

        size_t   p = 0;
        uint64_t n = vldec_u64(key + p, &p);

        if (n % 2 == 1)
            list.push_back(Entry(db.node(vldec_u64(key + p, &p))));

        for (unsigned i = 0; i < n/2; ++i) {
            bool      ok   = true;
            
            cali_id_t id   = static_cast<cali_id_t>(vldec_u64(key+p, &p));
            Variant   data = Variant::unpack(key+p, &p, &ok);

            if (ok)
                list.push_back(Entry(db.attribute(id), data));
        }
    }
开发者ID:LLNL,项目名称:Caliper,代码行数:19,代码来源:Aggregator.cpp

示例10: while

NameIterationTester::EntryList
NameIterationTester::getNamesFromIterator (CNameIterator& iter)
{
  EntryList res;

  valtype name;
  CNameData data;
  while (iter.next (name, data))
    res.push_back (std::make_pair (name, data));

  return res;
}
开发者ID:bankonme,项目名称:namecoin-core,代码行数:12,代码来源:name_tests.cpp

示例11: parseIdentifierList

void Parser::parseIdentifierList(EntryList& idList){
	if(isNext(tc_ID)){
		idList.push_back(m_currentToken->getSymTabEntry());
	}
	match(tc_ID);
	if(m_parserError){
		TokenCode synch[] = {tc_COMMA, tc_COLON, tc_NONE};
		recover(synch);
//		if(isNext(tc_ID)){
//			match(tc_ID);
//		}
	}
	parseIdentifierListPrime(idList);
}
开发者ID:nicolai490,项目名称:---endur,代码行数:14,代码来源:parser.cpp

示例12: addBuddyRelationData

void BuddyRelationLogic::addBuddyRelationData(Ice::Int id, 
		const BuddyRelationDataPtr& data) {
    EntryList list;
    ostringstream info;
    for (RelationEntryList::iterator en = data->list.begin(); en != data->list.end(); ++en) {
        Entry entry(en->id, BuddyDescHelper::translateInt(en->desc));
        list.push_back(entry);
        info << "<" << en->id << "/" << BuddyDescHelper::translateInt(en->desc) << "> ";
    }
    MCE_DEBUG("BuddyRelationLogic::addBuddyRelationData, id "<< id << " relations " << info.str());
    sort(list.begin(), list.end(), less_entry());
    EntryListHolderPtr holder = new EntryListHolder(id, list);

    writeObject(id, holder);
}
开发者ID:bradenwu,项目名称:oce,代码行数:15,代码来源:BuddyRelationLogic.cpp

示例13: handle

void FillTask::handle() {
	ObjectResultPtr result = new ObjectResult();
	for ( std::map<long, Ice::ObjectPtr>::const_iterator it = _buddyData->data.begin();
			it!= _buddyData->data.end(); ++it ){
		BuddyRelationDataPtr data = BuddyRelationDataPtr::dynamicCast(it->second);
		EntryList list;
		list.reserve(data->list.size());
		for(RelationEntryList::iterator en = data->list.begin(); en != data->list.end(); ++en) {
			Entry entry(en->id, BuddyDescHelper::translateInt(en->desc));
			list.push_back(entry);
		}
		sort(list.begin(), list.end(), less_entry());
		EntryListHolderPtr holder = new EntryListHolder(it->first, list);
		result->data[it->first] = holder;
	}
	
	_logic->writeObjects(result);
}
开发者ID:bradenwu,项目名称:oce,代码行数:18,代码来源:BuddyRelationLogic.cpp

示例14: createRelation

/*******************private interface***********************/
void BuddyRelationLogic::createRelation(const Relationship& relation,
		BuddyDesc desc) {
    BuddyRelationDataPtr data = BuddyRelationFactory::instance().create(relation.from);
    EntryList list;
    for(RelationEntryList::iterator en = data->list.begin(); en != data->list.end(); ++en) {
        Entry entry(en->id, BuddyDescHelper::translateInt(en->desc));
        list.push_back(entry);
    }
    sort(list.begin(), list.end(), less_entry());
    EntryListHolderPtr holder = new EntryListHolder(relation.from, list);

    Entry key;
    key.to = relation.to;
    key.desc = BuddyDescHelper::translateInt(desc);

    holder->add(key);

    writeObject(relation.from, holder);
}
开发者ID:bradenwu,项目名称:oce,代码行数:20,代码来源:BuddyRelationLogic.cpp

示例15: readAll

ConfigReader::EntryList ConfigReader::readAll() const
{
    EntryList currentConfig ;  
    using namespace boost::filesystem ;
    path currentPath ( m_currentPath);
    if ( exists(currentPath))
    {
        if ( is_directory(currentPath))
        {
            typedef std::vector<path> FilepathList ;
            FilepathList f ;
            copy(directory_iterator(currentPath), directory_iterator(), std::back_inserter(f));
            std::sort(f.begin(),f.end());

            for (FilepathList::const_iterator it (f.begin()); it != f.end(); ++it)
            {
                ConfigurationEntry ce = loadFromPath(it->leaf().string());
                currentConfig.push_back(ce);
            }

        }
    }
    return currentConfig ;
}
开发者ID:w0land,项目名称:watchdog,代码行数:24,代码来源:configreader.cpp


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