本文整理汇总了C++中EntryList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ EntryList::end方法的具体用法?C++ EntryList::end怎么用?C++ EntryList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EntryList
的用法示例。
在下文中一共展示了EntryList::end方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: generateCall
void Code::generateCall(SymbolTableEntry* entry, EntryList& eList)
{
EntryList::iterator it;
for(it = eList.begin(); it != eList.end(); it++)
generate(cd_APARAM,NULL,NULL,*it);
generate(cd_CALL,entry,NULL,NULL);
}
示例2: print
void print() {
std::map<int, double> totals;
std::cerr << "Timings: " << std::endl;
// print out all the entries.
//std::sort(root_entries.begin(), root_entries.end(), cmp());
printEntries(std::cerr, root_entries, " ", -1.0);
for (EntryList::const_iterator it = entries.begin(); it != entries.end(); ++it) {
totals[(*it).id] += (*it).time;
}
std::cerr << std::endl;
std::cerr << "Totals: " << std::endl;
std::vector<std::pair<int, double> > sorted_totals;
sorted_totals.reserve(totals.size());
for (std::map<int,double>::iterator it = totals.begin(); it != totals.end(); ++it) {
sorted_totals.push_back(*it);
}
std::sort(sorted_totals.begin(), sorted_totals.end(), cmp());
for (std::vector<std::pair<int,double> >::iterator it = sorted_totals.begin(); it != sorted_totals.end(); ++it) {
std::cerr << " ";
std::string str = names[it->first];
if (str.empty()) {
std::cerr << "(" << it->first << ")";
} else {
std::cerr << str;
}
std::cerr << " - " << it->second << "s " << std::endl;
}
}
示例3: stat
/**
* Stats the given file. If <tt>throttleRate</tt> seconds have passed since
* the last time stat() was called on this file, then the file will be
* re-stat()ted, otherwise the cached stat information will be returned.
*
* @param filename The file to stat.
* @param stat A pointer to a stat struct; the retrieved stat information
* will be stored here.
* @param throttleRate Tells this CachedFileStat that the file may only
* be statted at most every <tt>throttleRate</tt> seconds.
* @return 0 if the stat() call succeeded or if the cached stat information was used;
* -1 if something went wrong while statting the file. In the latter
* case, <tt>errno</tt> will be populated with an appropriate error code.
* @throws SystemException Something went wrong while retrieving the
* system time. stat() errors will <em>not</em> result in
* SystemException being thrown.
* @throws boost::thread_interrupted
*/
int stat(const string &filename, struct stat *buf, unsigned int throttleRate = 0) {
boost::unique_lock<boost::mutex> l(lock);
EntryMap::iterator it(cache.find(filename));
EntryPtr entry;
int ret;
if (it == cache.end()) {
// Filename not in cache.
// If cache is full, remove the least recently used
// cache entry.
if (maxSize != 0 && cache.size() == maxSize) {
EntryList::iterator listEnd(entries.end());
listEnd--;
string filename((*listEnd)->filename);
entries.pop_back();
cache.erase(filename);
}
// Add to cache as most recently used.
entry = EntryPtr(new Entry(filename));
entries.push_front(entry);
cache[filename] = entries.begin();
} else {
// Cache hit.
entry = *it->second;
// Mark this cache item as most recently used.
entries.erase(it->second);
entries.push_front(entry);
cache[filename] = entries.begin();
}
ret = entry->refresh(throttleRate);
*buf = entry->info;
return ret;
}
示例4: getFriends
SnapshotEntrySeqMap BuddyCoreSnapshotI::getFriends(const ::MyUtil::IntSeq& ids,
const Ice::Current& current) {
SnapshotEntrySeqMap result;
ServiceI& service = ServiceI::instance();
for (IntSeq::const_iterator it = ids.begin(); it != ids.end(); ++it) {
EntryListHolderPtr owner = service.findObject<EntryListHolderPtr>(
CATEGORY_ENTRY, *it);
if (!owner) {
continue;
}
EntryList ownerList = owner->getAll();
SnapshotEntrySeq ownerSnap;
for (EntryList::iterator ownerIt = ownerList.begin(); ownerIt
!= ownerList.end(); ++ownerIt) {
int ownerToId = ownerIt->to;
uint32_t ownerDesc = ownerIt->desc;
//MCE_INFO("Owner:"<<*it <<" Buddy:"<<ownerToId << " Desc:"<<ownerDesc);
if (ownerDesc!=DESC_FRIEND) {
continue;
}
SnapshotEntry entryOwner;
entryOwner.toId = ownerToId;
entryOwner.desc = BuddyDescHelper::translateDesc(ownerDesc);
ownerSnap.push_back(entryOwner);
}
result[*it] = ownerSnap;
}
return result;
}
示例5: Sort
void AssFile::Sort(EntryList &lst, CompFunc comp, std::set<AssDialogue*> const& limit) {
AssEntryComp compE;
compE.comp = comp;
// Sort each block of AssDialogues separately, leaving everything else untouched
for (entryIter begin = lst.begin(); begin != lst.end(); ++begin) {
if (!is_dialogue(&*begin, limit)) continue;
entryIter end = begin;
while (end != lst.end() && is_dialogue(&*end, limit)) ++end;
// used instead of std::list::sort for partial list sorting
EntryList tmp;
tmp.splice(tmp.begin(), lst, begin, end);
tmp.sort(compE);
lst.splice(end, tmp);
begin = --end;
}
}
示例6: insert
bool insert( Entry& e , vec_type& v )
{
if ( entries.find( e.ID() ) != entries.end() ) { return false; }
for ( typename vec_type::size_type ii=0; ii<v.size(); ++ii ) {
table[ii].insert( EDE( e , v[ii]) );
}
entries.insert( e.ID() );
return true;
}
示例7:
void MamdaOrderBookPriceLevel::MamdaOrderBookPriceLevelImpl::clearEntries (
EntryList& entries)
{
EntryList::iterator itr = entries.begin();
EntryList::iterator end = entries.end();
for (; itr != end; itr++)
{
delete *itr;
}
entries.clear();
}
示例8: Sort
void AssFile::Sort(EntryList<AssDialogue> &lst, CompFunc comp, std::set<AssDialogue*> const& limit) {
if (limit.empty()) {
lst.sort(comp);
return;
}
// Sort each selected block separately, leaving everything else untouched
for (auto begin = lst.begin(); begin != lst.end(); ++begin) {
if (!limit.count(&*begin)) continue;
auto end = begin;
while (end != lst.end() && limit.count(&*end)) ++end;
// sort doesn't support only sorting a sublist, so move them to a temp list
EntryList<AssDialogue> tmp;
tmp.splice(tmp.begin(), lst, begin, end);
tmp.sort(comp);
lst.splice(end, tmp);
begin = --end;
}
}
示例9: remove_entry
void ConfigSection::remove_entry(const char* key) {
E_ASSERT(key != NULL);
int klen = strlen(key);
unsigned int hh = do_hash(key, klen);
EntryListIter it = entry_list.begin();
for(; it != entry_list.end(); ++it) {
ConfigEntry* e = *it;
if(hh == e->hash && strncmp(e->key, key, e->keylen) == 0)
entry_list.erase(it);
}
}
示例10: list
Profile::EntryList Profile::list(List type)
{
EntryList parentList;
if (m_parent)
parentList = m_parent->list(type);
EntryList list = parentList;
for (EntryList::iterator it = list.begin(); it != list.end(); ++it)
(*it).derived = true;
QStringList &personalList = listByType(type);
for (QStringList::const_iterator it = personalList.begin(); it != personalList.end(); ++it)
list.append(Entry(*it, false));
return list;
}
示例11: AddUser
DB_Error DataBaseSqlite::AddUser(shared_ptr<User> user)
{
DB_Error ret = CreateTable("User");
if (ret == DB_OK)
{
EntryList entries = m_pTableComponent->GetTableFormat("User");
PDEBUG ("entry size: %lu\n", entries.size());
if (!entries.empty())
{
string sql(INSERT_TABLE);
sql += string("User") + VALUE + LPARENT;
EntryList::iterator iter = entries.begin();
EntryList::iterator end = entries.end();
for (; iter != end;)
{
sql += "@" + iter->name;
if (++iter != end)
{
sql += ", ";
}
}
sql += string(RPARENT) + SEMI;
SqliteCommand cmd(this, sql);
// Ugly hard code!!
PDEBUG ("Begin binding\n");
ret = cmd.Bind("@name", user->name());
ret = ret ? ret : cmd.Bind("@uuid", user->uuid());
int64 date = 0;
if (user->has_reg_date())
{
ret = user->reg_date();
}
ret = ret ? ret : cmd.Bind("@reg_date", date);
date = 0;
if (user->has_last_login())
{
date = user->last_login();
}
ret = ret ? ret : cmd.Bind("@last_login", date);
// Bind others ...
ret = ret ? ret : cmd.Execute();
// Execute ....
}
}
return ret;
}
示例12: find_entry
ConfigEntry* ConfigSection::find_entry(const char* key) {
E_ASSERT(key != NULL);
int klen = strlen(key);
unsigned int hh = do_hash(key, klen);
EntryListIter it = entry_list.begin(), it_end = entry_list.end();
for (; it != it_end; ++it) {
ConfigEntry* e = *it;
if (hh == e->hash && strncmp(e->key, key, e->keylen) == 0)
return e;
}
return NULL;
}
示例13: print
void print( std::ostream& o = std::cout ) const
{
o << "ED LOOKUP TABLE\n";
for ( typename EDTable::size_type ii=0; ii<table.size(); ++ii ) {
o << "\tDIMENSION: " << ii << '\n';
for ( typename DimensionEntries::const_iterator jj=table[ii].begin() ;
jj!=table[ii].end(); ++jj ) {
(jj)->print(o);
}
}
o << "\tCURRENT ENTRIES:\n";
for ( typename EntryList::const_iterator ii=entries.begin();
ii!=entries.end(); ++ii ) { o << *ii << '\n'; }
}
示例14: 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);
}
示例15: 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);
}