本文整理汇总了C++中UnitPtr::DumpToString方法的典型用法代码示例。如果您正苦于以下问题:C++ UnitPtr::DumpToString方法的具体用法?C++ UnitPtr::DumpToString怎么用?C++ UnitPtr::DumpToString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UnitPtr
的用法示例。
在下文中一共展示了UnitPtr::DumpToString方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExtractUnitFromLine
UnitPtr Restorer::ExtractUnitFromLine(string & str) {
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep("\t");
tokenizer tokens(str, sep);
int size = 0;
for (tokenizer::iterator tit = tokens.begin(); tit != tokens.end(); ++tit) {
++size;
}
if (size < 6) {//至少有六段
MCE_INFO("Restorer::ExtractUnitFromLine. wrong size:" << size << " str:" << str);
return NULL;
}
tokenizer::iterator itr = tokens.begin();
++itr;
Ice::Long id = lexical_cast<Ice::Long> (*itr++);
set<Ice::Long>::iterator it = outtag_ids_.find(id);
if (it != outtag_ids_.end()) {
MCE_INFO("Restorer::ExtractUnitFromLine. matched. id:" << id);
return NULL;
}
// if (it != outtag_ids_.end()) {
// --(it->second);
// if (it->second == 0) {
// outtag_ids_.erase(it);
// }
// MCE_INFO("Restorer::ExtractUnitFromLine. matched. id:" << id);
// return NULL;
// }
int retry = lexical_cast<int> (*itr++);
string instance = lexical_cast<string> (*itr++);
int wrflag = lexical_cast<int> (*itr++);
string pattern = lexical_cast<string> (*itr++);
string statement;
for (; itr != tokens.end(); ++itr) {
statement += lexical_cast<string> (*itr);
statement += "\t";
}
UnitPtr unit = new Unit(id, retry + 1, instance, wrflag, pattern, statement);
if (retry > MAX_RETRY) {
MCE_INFO("Restorer::ExtractUnitFromLine. retry exceed max_retry. " << unit->DumpToString());
return NULL;
}
return unit;
}