本文整理汇总了C++中ListIterator::NextNList方法的典型用法代码示例。如果您正苦于以下问题:C++ ListIterator::NextNList方法的具体用法?C++ ListIterator::NextNList怎么用?C++ ListIterator::NextNList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ListIterator
的用法示例。
在下文中一共展示了ListIterator::NextNList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: values
//.........这里部分代码省略.........
#endif
cmsg.inFunError("Record::In: Value list is of kind atom but "
"a list is expected! ");
return w;
}
// case 2
if (nl->ListLength(instance) != nl->ListLength(nl->Rest(typeInfo))) {
#ifdef RECORD_DEBUG
cerr << "Record::In: different number of elements in "
"type list and value list " << endl;
#endif
cmsg.inFunError("Record::In: different number of elements in "
"type list and Value list ");
return w;
}
}
// create type and value list iteratoren
ListIterator typeIter = nl->Rest(typeInfo);
ListIterator valueIter = instance;
// variables used inside the iteration loop
string elemName;
string elemTypeName;
int elemAlgebraId;
int elemTypeId;
Word elemWord;
Attribute* elem;
// iterate synchrone through the type and value list elements
while(typeIter.HasNext() && valueIter.HasNext()) {
// assign the current type list element
NList curType = typeIter.NextNList();
// assign the current value list element
ListExpr curValue;
if (hasValueList) {
curValue = valueIter.NextListExpr();
} else {
curValue = nl->OneElemList(nl->SymbolAtom(nullSymbol));
}
#ifdef RECORD_DEBUG
cerr << "Record::In: curType=" << curType.convertToString() << endl;
cerr << "Record::In: curValue=" << nl->ToString(curValue) << endl;
#endif
// the current type list has to contain 2 elements
// case 1: (string (int int))
// 1. element name
// 2. element type list with two integer values
// 2.1 algebraId
// 2.2 typeId
// case 2: (string ((int int) ...))
// 1. element name
// 2. element type as list, first list item contains
// two integer values
if ( !( curType.length() == 2
&& curType.second().length() == 2
&& curType.second().first().isInt()
&& curType.second().second().isInt())
&& !( curType.length() == 2
&& curType.second().length() > 0
&& curType.second().first().length() == 2
&& curType.second().first().first().isInt()