本文整理汇总了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));
}
}
示例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);
}
示例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);
}
}
示例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);
}
}
示例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;
}
示例6: parseExpressionListPrime
void Parser::parseExpressionListPrime(EntryList& expList){
if(isNext(tc_COMMA)){
match(tc_COMMA);
expList.push_back(parseExpression());
parseExpressionListPrime(expList);
}
}
示例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);
}
示例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;
}
示例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));
}
}
示例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;
}
示例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);
}
示例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);
}
示例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);
}
示例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);
}
示例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 ;
}