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


C++ NodePtr::appendComment方法代码示例

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


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

示例1: handleResult

NodePtr CommonBfJlModules::handleResult(int iJId, NodePtr pNode, const std::string& sResult)
{
	m_nDoingJobs--;
	assert(m_pBfsHandler != nullptr);
	assert(m_pGameHandler != nullptr);
	assert(m_pIntegrator != nullptr);
	std::ostringstream oss;
	GameParser* pGameParser = m_pGameHandler->makeGameParser(sResult);
	if (m_pGameHandler->isNodeAlreadyExist(pNode, pGameParser)) {
		if (m_pGameHandler->handleDuplicateNode(pNode)) {
			oss << std::endl << "Handle duplicate node: Set StopExpanding true" << std::endl << "Receive job ID " << iJId 
				<< ": " << sResult << std::endl;
			pNode->appendComment(oss.str());
		} else {
			oss << "Error: New node already exist, JID: " << iJId
					  << ", Result: " << sResult << std::endl;
			std::cerr << oss.str() << "> " << std::flush;
			pNode->appendComment(oss.str());
		}
		restorePreUpdate(pNode);
		return nullptr;
	}
	NodePtr pNewNode = m_pGameHandler->generateNode(pNode, pGameParser);

	oss.str("");
	oss << "Receive job ID " << iJId << ": " << sResult << std::endl;
	pNewNode->appendComment(oss.str());

	if (JobLevelConfigure::g_configure.bUseJobLog) {
		std::ofstream fout(JobLevelConfigure::g_configure.sJobLogFile.c_str(), std::ios::app);
		fout << oss.str();
		fout.close();
	}

	BfsRetriever* pBfsRetriever = m_pIntegrator->makeRetriever(pGameParser);
	m_pBfsHandler->setupBfsData(pNewNode, pBfsRetriever);
	m_pGameHandler->setupGameData(pNewNode, pGameParser);

	delete pGameParser;
	delete pBfsRetriever;

	return pNewNode;
}
开发者ID:CGI-LAB,项目名称:Job-Level-Framework,代码行数:43,代码来源:CommonBfJlModules.cpp

示例2: dispatch

bool CommonBfJlModules::dispatch(NodePtr pNode)
{
	assert(m_pBfsHandler != nullptr);
	assert(m_pGameHandler != nullptr);
	std::ostringstream oss;
	if (m_pBfsHandler->isRunningJob(pNode)) {
		oss << "Error : the node to dispathch is running job" << std::endl;
		std::cerr << oss.str() << "> " << std::flush;
		pNode->appendComment(oss.str());
		return false;
	} else if (m_pBfsHandler->isFlagged(pNode)) {
		oss << "Error : the node to dispatch is flagged" << std::endl;
		std::cerr << oss.str() << "> " << std::flush;
		pNode->appendComment(oss.str());
		return false;
	}

	std::string sAppName = m_pGameHandler->getAppName();
	std::string sAppVersion = m_pGameHandler->getAppVersion();
	std::string sArgument = m_pGameHandler->prepareJobCommands(pNode);

	int iJId = submitJob(pNode, sAppName, sAppVersion, sArgument);

	oss.str("");
	oss << "Submit job ID " << iJId << ": " << sArgument << std::endl;
	pNode->appendComment(oss.str());

	if (JobLevelConfigure::g_configure.bUseJobLog) {
		std::ofstream fout(JobLevelConfigure::g_configure.sJobLogFile.c_str(), std::ios::app);
		fout << oss.str();
		fout.close();
	}

	m_nDoingJobs++;
	m_nTotalJobs++;
	return true;
}
开发者ID:CGI-LAB,项目名称:Job-Level-Framework,代码行数:37,代码来源:CommonBfJlModules.cpp


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