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


C++ TreeNode::clone方法代码示例

本文整理汇总了C++中TreeNode::clone方法的典型用法代码示例。如果您正苦于以下问题:C++ TreeNode::clone方法的具体用法?C++ TreeNode::clone怎么用?C++ TreeNode::clone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TreeNode的用法示例。


在下文中一共展示了TreeNode::clone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: testDeath

	void QueryParser::testDeath(string _zap)
	{
		try {
			TreeNode *tree = parser->parse(_zap).release();
			tree->putToString();
			QParser::DeathRmver *rmver = new QParser::DeathRmver(this);
			TreeNode *nt = tree->clone();
			rmver->rmvDeath(nt);
		} catch (...) {
		}
	}
开发者ID:ptryfon,项目名称:loxim-stats,代码行数:11,代码来源:QueryParser.cpp

示例2: testParse

	int QueryParser::testParse (string query, TreeNode *&/*qTree*/) {
		string zap = "EMP where SAL = (EMP where NAME=\"KUBA\").SAL;";

		if (false && (query == zap)){
			TreeNode *tree = parser->parse(zap).release();

			//printf( "po parsowaniu treeNode: %d. \n", tree);
			cout << "Odczyt z drzewka, ktore przekazuje:" << endl;
			cout << "--------------------------------------" << endl;
			tree->putToString();
			cout << "\n--------------------------------------" << endl;
			QParser::Optimiser *opt = new QParser::Optimiser();
			int reslt;
			cout << "now the following tree will be evaluated statically.." << endl;
			TreeNode *nt = tree->clone();

			if ((reslt = opt->stEvalTest(nt)) != 0)
				fprintf (stderr, "static evaluation did not work out...\n");
			else {
				cout << "static evaluatioin OK, result: "<< reslt << endl;


				fprintf (stderr, "now I will try to optimise the tree..\n");

				cout << "OPTYMALIZUJE--------------------------------------------------------"<< endl;
				//cout << "przed optymalizacjia" << endl;
				//nt->putToString();
				//cout << "-----------" << endl;

				int ooptres = nt->optimizeTree();
				cout << "KONIEC OPTYMALIZACJI-------------------------------------------------------"<< endl;
				/*the nt tree needs to be 'rolled' up: (in case the nonalgopnode
				  we were operating on was the root... */
				while (nt->getParent() != NULL) nt = nt->getParent();

				fprintf (stderr, "__%d__", ooptres);

				cout << "po JEDNYM PRZEBIEGU optymalizacji" << endl;
				nt->putToString();
				cout << "-----------" << endl;
				fprintf (stderr, "end of optimisation.\n");
			}
			cout << "TEST END__---------------------------------------------------------------------------------" << endl;
		}

		cout << "koniec parseIt\n";
		return 0;
	}
开发者ID:ptryfon,项目名称:loxim-stats,代码行数:48,代码来源:QueryParser.cpp


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