本文整理汇总了C++中ConstIterator::isEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ ConstIterator::isEnd方法的具体用法?C++ ConstIterator::isEnd怎么用?C++ ConstIterator::isEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConstIterator
的用法示例。
在下文中一共展示了ConstIterator::isEnd方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: genItLoopCCode
/******************* FUNCTION *********************/
void ProjectActionOld::genItLoopCCode ( ostream& out, const CMRProjectContext& context, int depth ) const
{
CMRProjectContext localContext(&context);
//errors
assert(name == "cmrSubBlock" && description == "cmrIteratorLoop");
//search the related iterator definition
const CMRProjectEntity * entity = context.parent->find(eq->latexEntity);
if (entity == NULL)
{
cerr << "Can't find the definition of iterator " << eq->compute << " in current context." << endl;
abort();
}
const CMRProjectIterator * iterator = dynamic_cast<const CMRProjectIterator*>(entity);
if (iterator == NULL)
{
cerr << "Cuation, expect iterator " << eq->compute << " but get another type." << endl;
context.printDebug();
abort();
}
assert(iterator != NULL);
CMRProjectLocalVariable localVar(eq->compute,eq->compute);
localContext.addEntry(&localVar);
out << genCCodeIndent(depth) << "for (int " << eq->compute << " = " << iterator->start << " ; " << eq->compute << " < " << iterator->end << " ; " << eq->compute << "++ )" <<endl;
out << genCCodeIndent(depth) << "{" << endl;
for (ConstIterator it = getFirstChild() ; ! it.isEnd() ; ++it)
it->genCCode(out,it->context,depth+1);
//it->genCCode(out,localContext,depth+1);
out << genCCodeIndent(depth) << "}" << endl;
//checkContext(localContext);
}
示例2: genRootElemCCode
/******************* FUNCTION *********************/
void ProjectActionOld::genRootElemCCode ( ostream& out, const CMRProjectContext& context, int depth ) const
{
CMRProjectContext localContext(&context);
for (ConstIterator it = getFirstChild() ; ! it.isEnd() ; ++it)
it->genCCode(out,it->context,depth+1);
//it->genCCode(out,localContext,depth+1);
//checkContext(localContext);
}
示例3: printDebug
/******************* FUNCTION *********************/
void ProjectActionOld::printDebug(int depth) const
{
for (int i = 0 ; i < depth ; i++)
cout << "\t";
if (name == "cmrEquation")
{
cout << this->eq->latexName << " = " << this->eq->compute << endl;
} else {
if (eq != NULL)
cout << name << " - " << description << " - " << eq->compute << ":" << endl;
else
cout << name << " - " << description << ":" << endl;
for (ConstIterator it = getFirstChild() ; ! it.isEnd() ; ++it)
it->printDebug(depth+1);
}
}