本文整理汇总了C++中entries函数的典型用法代码示例。如果您正苦于以下问题:C++ entries函数的具体用法?C++ entries怎么用?C++ entries使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了entries函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
示例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()
示例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);
}
示例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;
}
示例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
}
}
}
}
示例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>();
}
示例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;
}
}
}
示例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);
}
}
示例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;
}
}
}
示例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;
}
示例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;
}
}