本文整理汇总了C++中entries函数的典型用法代码示例。如果您正苦于以下问题:C++ entries函数的具体用法?C++ entries怎么用?C++ entries使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了entries函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: getFirstItem
//------------------------------------------------------------------------------
// operator== Returns true if two lists are equal.
//------------------------------------------------------------------------------
bool List::operator==(const List& l) const
{
if (entries() != l.entries()) return false;
const Item* tt = getFirstItem();
const Item* ll = l.getFirstItem();
while (tt != nullptr) {
if (tt->getValue() != ll->getValue()) return false;
tt = tt->getNext();
ll = ll->getNext();
}
return true;
}
开发者ID:jmc734,项目名称:OpenEaagles,代码行数:17,代码来源:List.cpp
示例2: entries
// Is this frame a subset of 'other'?
bool
Frame::subset_elements (const Metalib& metalib, const Frame& other) const
{
// Find syntax entries.
std::set<symbol> all;
entries (all);
// Loop over them.
for (std::set<symbol>::const_iterator i = all.begin (); i != all.end (); i++)
if (!subset (metalib, other, *i))
return false;
return true;
}
开发者ID:pamoakoy,项目名称:daisy-model,代码行数:15,代码来源:frame.C
示例3: Q_Q
bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenuData &data)
{
Q_Q(QQuickWebEngineView);
QObject *menu = ui()->addMenu(0, QString(), data.pos);
if (!menu)
return false;
// Populate our menu
MenuItemHandler *item = 0;
if (data.selectedText.isEmpty()) {
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, q, &QQuickWebEngineView::goBack);
ui()->addMenuItem(item, QObject::tr("Back"), QStringLiteral("go-previous"), q->canGoBack());
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, q, &QQuickWebEngineView::goForward);
ui()->addMenuItem(item, QObject::tr("Forward"), QStringLiteral("go-next"), q->canGoForward());
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, q, &QQuickWebEngineView::reload);
ui()->addMenuItem(item, QObject::tr("Reload"), QStringLiteral("view-refresh"));
} else {
item = new CopyMenuItem(menu, data.selectedText);
ui()->addMenuItem(item, QObject::tr("Copy..."));
}
if (!data.linkText.isEmpty() && data.linkUrl.isValid()) {
item = new NavigateMenuItem(menu, adapter, data.linkUrl);
ui()->addMenuItem(item, QObject::tr("Navigate to..."));
item = new CopyMenuItem(menu, data.linkUrl.toString());
ui()->addMenuItem(item, QObject::tr("Copy link address"));
}
// FIXME: expose the context menu data as an attached property to make this more useful
if (contextMenuExtraItems) {
ui()->addMenuSeparator(menu);
if (QObject* menuExtras = contextMenuExtraItems->create(qmlContext(q))) {
menuExtras->setParent(menu);
QQmlListReference entries(menu, defaultPropertyName(menu), qmlEngine(q));
if (entries.isValid())
entries.append(menuExtras);
}
}
// Now fire the popup() method on the top level menu
QMetaObject::invokeMethod(menu, "popup");
return true;
}
开发者ID:venkatarajasekhar,项目名称:Qt,代码行数:50,代码来源:qquickwebengineview.cpp
示例4: entries
/** \brief Write a FileCollection to the output stream.
*
* This function writes a simple textual representation of this
* FileCollection to the output stream.
*
* \param[in,out] os The output stream.
* \param[in] collection The collection to print out.
*
* \return A reference to the \p os output stream.
*/
std::ostream& operator << (std::ostream& os, FileCollection const& collection)
{
os << "collection '" << collection.getName() << "' {";
FileEntry::vector_t entries(collection.entries());
char const *sep("");
for(auto it = entries.begin(); it != entries.end(); ++it)
{
os << sep;
sep = ", ";
os << (*it)->getName();
}
os << "}";
return os;
}
开发者ID:pgquiles,项目名称:zipios,代码行数:24,代码来源:filecollection.cpp
示例5: getApp
void
ViewerNode::refreshViewsKnobVisibility()
{
KnobChoicePtr knob = _imp->activeViewKnob.lock();
if (knob) {
const std::vector<std::string>& views = getApp()->getProject()->getProjectViewNames();
std::vector<ChoiceOption> entries(views.size());
for (std::size_t i = 0; i < views.size(); ++i) {
entries[i] = ChoiceOption(views[i], "", "");
}
knob->populateChoices(entries);
knob->setInViewerContextSecret(views.size() <= 1);
}
}
开发者ID:ebrayton,项目名称:Natron,代码行数:14,代码来源:ViewerNode.cpp
示例6: nowarn
// -----------------------------------------------------------------------
// Print function for TableDescList
// -----------------------------------------------------------------------
void TableDescList::print(FILE* ofd, const char* indent, const char* title)
{
#ifndef NDEBUG
#pragma nowarn(1506) // warning elimination
BUMP_INDENT(indent);
#pragma warn(1506) // warning elimination
for (CollIndex i = 0; i < entries(); i++)
{
fprintf(ofd,"%s%s[%2d] = (%p)\n",NEW_INDENT,title,i,at(i));
// at(i)->print(ofd,indent);
}
#endif
} // TableDescList::print()
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:17,代码来源:TableDesc.cpp
示例7: entries
void TableFormat::writeRow(
std::ostream& out,
int rowIndex,
const Array<TableColumn>& columns
) const
{
Array<RCP<TableEntry> > entries(columns.size());
for (Array<TableColumn>::size_type i=0; i<columns.size(); i++)
{
entries[i] = columns[i].entry(rowIndex);
}
writeRow(out, entries);
}
开发者ID:00liujj,项目名称:trilinos,代码行数:14,代码来源:Teuchos_TableFormat.cpp
示例8: ComASSERT
// index access (both reference and value) to the
// list represented by this left linear tree
//
// 1 entry 2 entries > 2 entries
// [op] [op]
// [0] / \ / \
// [0] [1] [op] [2]
// / \
// [0] [1]
//
// [op] represents ElemDDLList node
// [0], [1], [2] represent the leaf nodes. The
// number between the square brackets represents
// the index of a leaf node in the list represented
// by the left linear tree.
//
// The case of 1 entry is not handled by this class.
// This case is handled by the class ElemDDLNode.
//
// The algorithem in this method is very inefficient.
// If the list is long and you would like to visit
// all leaf nodes in the left linear tree, please use
// the method traverseList instead.
//
ElemDDLNode *
ElemDDLList::operator[](CollIndex index)
{
CollIndex count;
ElemDDLNode * pElemDDLNode = this;
if (index >= entries())
{
return NULL;
}
if (index EQU 0)
{
for (count = 1; count < entries(); count ++)
{
pElemDDLNode = pElemDDLNode->getChild(0)->castToElemDDLNode();
}
ComASSERT(pElemDDLNode->getOperatorType() NEQ getOperatorType());
return pElemDDLNode;
}
count = entries() - index;
while (pElemDDLNode NEQ NULL AND count > 0)
{
if (pElemDDLNode->getOperatorType() EQU getOperatorType() AND
pElemDDLNode->getArity() >= 2)
{
if (count EQU 1)
pElemDDLNode = pElemDDLNode->getChild(1)->castToElemDDLNode();
else
pElemDDLNode = pElemDDLNode->getChild(0)->castToElemDDLNode();
}
count--;
}
ComASSERT(pElemDDLNode->getOperatorType() NEQ getOperatorType());
return pElemDDLNode;
}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:61,代码来源:ElemDDLList.cpp
示例9: size
void playfield::initialize_playfield(const int &psize,const int &smaxnumber,const vector<vector<int> > &vertblocks,
const vector<vector<int> > &horblocks)
{
somethingchanges=false;
size()=psize;
maxnumber=smaxnumber;
vblocks()=vertblocks;
hblocks()=horblocks;
entries().resize(size());
for(unsigned int i=0;i<entries().size();++i) {
entries().at(i).resize(size());
} // Größe der Feldelementmatrix Festlegen
vpermutations.resize(psize);
hpermutations.resize(psize);
vector<bool> temp;
temp.assign(true,smaxnumber+1); // indizies Werte von 0,1,2,..,maxnumber
possp.spalte.resize(psize);
possp.zeile.resize(psize);
for(int i=0;i<psize;++i) {
possp.zeile[i].resize(smaxnumber+1);
possp.spalte[i].resize(smaxnumber+1);
for(int j=0;j<=smaxnumber;++j) {
possp.spalte[i][j]=true;
possp.zeile[i][j]=true;
}
} // Am Anfang sind alle Werte moeglich
feldelpos.resize(psize);
for(int j=0;j<psize;++j) {
feldelpos[j].resize(psize);
for(int k=0;k<psize;++k) {
feldelpos[j][k].wertpossible.resize(smaxnumber+1);
for(int l=0;l<=smaxnumber;++l) {
feldelpos[j][k].wertpossible[l]=true; // a priori sind in jedem Feld alle werte moeglich
}
}
}
}
开发者ID:volkerbecker,项目名称:japsum,代码行数:37,代码来源:playfield.cpp
示例10: check_frozen
Object* MethodTable::remove(STATE, Symbol* name) {
check_frozen(state);
utilities::thread::SpinLock::LockGuard lg(lock_);
native_int num_entries = entries()->to_native();
native_int num_bins = bins()->to_native();
if(min_density_p(num_entries, num_bins) &&
(num_bins >> 1) >= METHODTABLE_MIN_SIZE) {
redistribute(state, num_bins >>= 1);
}
native_int bin = find_bin(key_hash(name), num_bins);
MethodTableBucket* entry = try_as<MethodTableBucket>(values()->at(state, bin));
MethodTableBucket* last = NULL;
while(entry) {
if(entry->name() == name) {
Object* val = entry->method();
if(last) {
last->next(state, entry->next());
} else {
values()->put(state, bin, entry->next());
}
entries(state, Fixnum::from(entries()->to_native() - 1));
return val;
}
last = entry;
entry = try_as<MethodTableBucket>(entry->next());
}
return nil<Executable>();
}
开发者ID:JesseChavez,项目名称:rubinius,代码行数:36,代码来源:method_table.cpp
示例11: finish_algorithm
void finish_algorithm()const
{
if(num_piles>0){
/* Mark those elements which are in their correct position, i.e. those
* belonging to the longest increasing subsequence. These are those
* elements linked from the top of the last pile.
*/
entry* ent=entries()[num_piles-1].pile_top_entry;
for(std::size_t n=num_piles;n--;){
ent->ordered=true;
ent=ent->previous;
}
}
}
开发者ID:BackupTheBerlios,项目名称:senf-svn,代码行数:15,代码来源:index_matcher.hpp
示例12: nowarn
void NAColumnArray::print(FILE* ofd, const char* indent, const char* title,
CollHeap *c, char *buf) const
{
Space * space = (Space *)c;
char mybuf[1000];
#pragma nowarn(1506) // warning elimination
BUMP_INDENT(indent);
#pragma warn(1506) // warning elimination
for (CollIndex i = 0; i < entries(); i++)
{
snprintf(mybuf, sizeof(mybuf), "%s%s[%2d] =", NEW_INDENT, title, i);
PRINTIT(ofd, c, space, buf, mybuf);
at(i)->print(ofd, "", "", c, buf);
}
}
开发者ID:robertamarton,项目名称:incubator-trafodion,代码行数:15,代码来源:NAColumn.cpp
示例13: encodeAndNormalize
void FormData::get(const String& name, FormDataEntryValue& result)
{
const CString encodedName = encodeAndNormalize(name);
for (const auto& entry : entries()) {
if (entry->name() == encodedName) {
if (entry->isString()) {
result.setUSVString(decode(entry->value()));
} else {
ASSERT(entry->isFile());
result.setFile(entry->file());
}
return;
}
}
}
开发者ID:azureplus,项目名称:chromium,代码行数:15,代码来源:FormData.cpp
示例14: entries
QgsWKBTypes::Type QgsWKBTypes::parseType( const QString &wktStr )
{
QString typestr = wktStr.left( wktStr.indexOf( '(' ) ).simplified().remove( ' ' );
QMap<QgsWKBTypes::Type, QgsWKBTypes::wkbEntry>* knownTypes = entries();
QMap<QgsWKBTypes::Type, QgsWKBTypes::wkbEntry>::const_iterator it = knownTypes->constBegin();
for ( ; it != knownTypes->constEnd(); ++it )
{
if ( it.value().mName.compare( typestr, Qt::CaseInsensitive ) == 0 )
{
return it.key();
}
}
return Unknown;
}
开发者ID:AM7000000,项目名称:QGIS,代码行数:15,代码来源:qgswkbtypes.cpp
示例15: replica_list_directory
void replica_list_directory (saga_tools::common & c,
std::string ldn)
{
// instantiate logical directory
saga::replica::logical_directory ld (c.session (), saga::url (ldn));
// read replica entries
std::vector <saga::url> entries (ld.list ());
std::vector <saga::url>::const_iterator it;
for ( it = entries.begin (); it != entries.end (); ++it )
{
std::cout << " " << (*it) << std::endl;
}
}
开发者ID:saga-project,项目名称:saga-cpp,代码行数:16,代码来源:list_directory.cpp
示例16: getSyntax
// method for building text
NAString ElemDDLList::getSyntax(NAString separator) const
{
NAString syntax;
ElemDDLList * ncThis = (ElemDDLList*)this;
syntax = (*ncThis)[0]->getSyntax();
// notice we start from i = 1
for (CollIndex i = 1 ; i < entries() ; i++)
{
syntax += separator;
syntax += (*ncThis)[i]->getSyntax();
}
return syntax;
}
开发者ID:AlexPeng19,项目名称:incubator-trafodion,代码行数:18,代码来源:ElemDDLList.cpp
示例17: qDebug
void OFonoPhoneBook::getEntries(const QString & store)
{
qDebug() << "OFonoPhoneBook::getEntries store=" << store;
// We support only "SM" store
if (store != "SM") {
QList < QPhoneBookEntry > list;
emit entries(store, list);
return;
}
if (!service->interfaceAvailable(&service->oPhoneBook)) {
wantEntries = true;
return;
}
import();
}
开发者ID:Artox,项目名称:qtmoko,代码行数:17,代码来源:ofonophonebook.cpp
示例18: insanities
void Cache::printNewInsanity(InfoStreamPtr infoStream, boost::any value)
{
Collection<InsanityPtr> insanities(FieldCacheSanityChecker::checkSanity(FieldCachePtr(_wrapper)));
for (Collection<InsanityPtr>::iterator insanity = insanities.begin(); insanity != insanities.end(); ++insanity)
{
Collection<FieldCacheEntryPtr> entries((*insanity)->getCacheEntries());
for (Collection<FieldCacheEntryPtr>::iterator entry = entries.begin(); entry != entries.end(); ++entry)
{
if (VariantUtils::equalsType((*entry)->getValue(), value))
{
// OK this insanity involves our entry
*infoStream << L"WARNING: new FieldCache insanity created\nDetails: " + (*insanity)->toString() << L"\n";
break;
}
}
}
}
开发者ID:alesha1488,项目名称:LucenePlusPlus,代码行数:17,代码来源:FieldCacheImpl.cpp
示例19: ng
//Symmetric Shiftbeta
int symshiftbeta::discount(ngram ng_,int size,double& fstar,double& lambda, int /* unused parameter: cv */)
{
ngram ng(dict);
ng.trans(ng_);
// cout << "size :" << size << " " << ng <<"\n";
// Pr(x/y)= max{(c([x,y])-beta)/(N Pr(y)),0} + lambda Pr(x)
// lambda=#bigrams/N
assert(size<=2); // only works with bigrams //
if (size == 3) {
ngram history=ng;
}
if (size == 2) {
//compute unigram probability of denominator
ngram unig(dict,1);
*unig.wordp(1)=*ng.wordp(2);
double prunig=unigr(unig);
//create symmetric bigram
if (*ng.wordp(1) > *ng.wordp(2)) {
int tmp=*ng.wordp(1);
*ng.wordp(1)=*ng.wordp(2);
*ng.wordp(2)=tmp;
}
lambda=beta[2] * (double) entries(2)/(double)totfreq();
if (get(ng,2,2)) {
fstar=(double)((double)ng.freq - beta[2])/
(totfreq() * prunig);
} else {
fstar=0;
}
} else {
fstar=unigr(ng);
lambda=0.0;
}
return 1;
}
开发者ID:shyamjvs,项目名称:cs626_project,代码行数:47,代码来源:shiftlm.cpp
示例20: redistribute
Object* MethodTable::store(STATE, Symbol* name, Object* exec, Symbol* vis) {
unsigned int num_entries, num_bins, bin;
MethodTableBucket* entry;
MethodTableBucket* last = NULL;
Executable* method;
if(exec->nil_p()) {
method = reinterpret_cast<Executable*>(Qnil);
} else {
if(Alias* alias = try_as<Alias>(exec)) {
method = alias->original_exec();
} else {
method = as<Executable>(exec);
}
}
num_entries = entries_->to_native();
num_bins = bins_->to_native();
if(max_density_p(num_entries, num_bins)) {
redistribute(state, num_bins <<= 1);
}
bin = find_bin(key_hash(name), num_bins);
entry = try_as<MethodTableBucket>(values_->at(state, bin));
while(entry) {
if(entry->name() == name) {
entry->method(state, method);
entry->visibility(state, vis);
return name;
}
last = entry;
entry = try_as<MethodTableBucket>(entry->next());
}
if(last) {
last->next(state, MethodTableBucket::create(state, name, method, vis));
} else {
values_->put(state, bin, MethodTableBucket::create(state, name, method, vis));
}
entries(state, Fixnum::from(num_entries + 1));
return name;
}
开发者ID:MarkusQ,项目名称:rubinius,代码行数:45,代码来源:methodtable.cpp
注:本文中的entries函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论