本文整理汇总了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;
}
示例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;
}