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


C++ ptree::rbegin方法代码示例

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


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

示例1: ifs

vector<shared_ptr<Program>> GeneratorStage::createPrograms(boost::property_tree::ptree& programTree, std::mt19937_64& randomEngine) {
	/*if (inputName != "") {
		ifstream ifs(inputName);
		return readPrograms(*game, gameType, programType, ifs);
	}*/

	programTree = cpputil::solveReference(config, programTree);
	programTree.sort();
	string programName = programTree.rbegin()->first;
	pt::ptree concreteProgramTree = programTree.rbegin()->second;


	/*if (programName == "GraycodeMapping") {
		for (int i = 0; i < programNum; ++i) {
			shared_ptr<GrayCodeMapping> gray = make_shared<GrayCodeMapping>(game.getProgramType());
			gray->randomize(randomEngine);
			programs.push_back(gray);
		}
	}*/

	/*} else if (programName == "ExpressionTree") {
		vector<shared_ptr<ExpressionTree>> ps = ExpressionTree::generate(game->getProgramType(), concreteProgramTree, size, randomEngine);
		for (shared_ptr<ExpressionTree> p : ps) {
			programs.push_back(p);
		}

	} else if (programName == "InstructionSequence") {
		for (int i = 0; i < size; ++i) {
			programs.push_back(make_shared<InstructionSequence>(game->getProgramType(), concreteProgramTree, size, randomEngine));
		}

	} else if (programName == "FeedforwardNetwork") {*/


	vector<shared_ptr<Program>> programs;
	auto global = Reflection::get_mutable_instance().getGlobal();
	auto theClass = global->getScope(programName);
	auto genOp = theClass->getFunction<std::vector<std::shared_ptr<Program>>(const ProgramType&, const boost::property_tree::ptree&, int size, std::mt19937_64&)>("generate");
	programs = vector<shared_ptr<Program>>(genOp(game->getProgramType(), concreteProgramTree, size, randomEngine));

	cerr << "Program: " << programName << endl;
	this->programName = programName;
	return programs;
}
开发者ID:kryozahiro,项目名称:gamesolver,代码行数:44,代码来源:GeneratorStage.cpp


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