当前位置: 首页>>代码示例>>C++>>正文


C++ ConstIterator::isEnd方法代码示例

本文整理汇总了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);
}
开发者ID:svalat,项目名称:CMR,代码行数:36,代码来源:ProjectActionOld.cpp

示例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);
}
开发者ID:svalat,项目名称:CMR,代码行数:9,代码来源:ProjectActionOld.cpp

示例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);
	}
}
开发者ID:svalat,项目名称:CMR,代码行数:17,代码来源:ProjectActionOld.cpp


注:本文中的ConstIterator::isEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。