本文整理汇总了C++中EntryList类的典型用法代码示例。如果您正苦于以下问题:C++ EntryList类的具体用法?C++ EntryList怎么用?C++ EntryList使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了EntryList类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: hasInEntryList
bool Profile::hasInEntryList(EntryList &list, QString value)
{
for (EntryList::const_iterator it = list.constBegin(); it != list.constEnd(); ++it)
if ((*it).name == value)
return true;
return false;
}
示例2: i18n
/**
* This method performs the search and displays
* the result to the screen.
*/
void Kiten::searchAndDisplay( const DictQuery &query )
{
/* keep the user informed of what we are doing */
_statusBar->showMessage( i18n( "Searching..." ) );
/* This gorgeous incantation is all that's necessary to fill a DictQuery
with a query and an Entrylist with all of the results form all of the
requested dictionaries */
EntryList *results = _dictionaryManager.doSearch( query );
/* if there are no results */
if ( results->size() == 0 ) //TODO: check here if the user actually prefers this
{
//create a modifiable copy of the original query
DictQuery newQuery( query );
bool tryAgain = false;
do
{
//by default we don't try again
tryAgain = false;
//but if the matchtype is changed we try again
if ( newQuery.getMatchType() == DictQuery::Exact )
{
newQuery.setMatchType( DictQuery::Beginning );
tryAgain = true;
}
else if ( newQuery.getMatchType() == DictQuery::Beginning )
{
newQuery.setMatchType( DictQuery::Anywhere );
tryAgain = true;
}
//try another search
if ( tryAgain )
{
delete results;
results = _dictionaryManager.doSearch( newQuery );
//results means all is ok; don't try again
if ( results->size() > 0 )
{
tryAgain = false;
}
}
} while ( tryAgain );
}
/* synchronize the history (and store this pointer there) */
addHistory( results );
/* Add the current search to our drop down list */
_inputManager->setSearchQuery( results->getQuery() );
/* suppose it's about time to show the users the results. */
displayResults( results );
}
示例3: 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;
}
示例4: EntryList
void Parser::parseExpressionList(SymbolTableEntry* prevEntry){
EntryList expList = *(new EntryList());
//expList.push_back(prevEntry);
expList.push_back(parseExpression());
parseExpressionListPrime(expList);
m_code->generateCall(prevEntry, expList);
}
示例5: 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;
}
}
示例6: 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);
}
示例7: processCommand
/*
This function processes the command passed in.
in: command
in/out: list and listSize
*/
void processCommand(char command, EntryList& list)
{
TaskList entry;
char courseName[iMAX_CHAR];
char a_cAssignmentDescription[iMAX_CHAR];
char a_cDueDate[iMAX_CHAR];
switch (command) {
case 'a':
readInEntry(entry);
list.addEntry(entry); // this has access to TaskList functions
break;
case 'l':
cout << endl;
list.printAll();
cout << endl << endl;
break;
case 's':
readInName(courseName);
list.searchEntry(courseName, entry);
break;
case 'r':
readInName(courseName);
list.searchDeleteEntry(courseName, entry);
break;
default:
cout << endl << "Illegal Command!" << endl;
break;
}
}
示例8: 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));
}
}
示例9: EntryList
/**
* Examine the DictQuery and farm out the search to the specialized dict
* managers. Note that a global search limit will probably be implemented
* either here or in the DictFile implementations... probably both
*
* @param query the query, see DictQuery documentation
*/
EntryList *DictionaryManager::doSearch( const DictQuery &query ) const
{
EntryList *ret = new EntryList();
#if 0
if( query.getMeaning() == "(libkiten)" )
{
ret->append( new debug_entry( "Summary of libkiten data" ) );
foreach( const QString &dict, listDictionaries() )
{
ret->append( new debug_entry( dict ) );
}
示例10:
void MamdaOrderBookPriceLevel::MamdaOrderBookPriceLevelImpl::clearEntries (
EntryList& entries)
{
EntryList::iterator itr = entries.begin();
EntryList::iterator end = entries.end();
for (; itr != end; itr++)
{
delete *itr;
}
entries.clear();
}
示例11: 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;
}
示例12: 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;
}
示例13: E_ASSERT
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);
}
}
示例14: CreateTable
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;
}
示例15: 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'; }
}