本文整理汇总了C++中Progress::SetStep方法的典型用法代码示例。如果您正苦于以下问题:C++ Progress::SetStep方法的具体用法?C++ Progress::SetStep怎么用?C++ Progress::SetStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Progress
的用法示例。
在下文中一共展示了Progress::SetStep方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ExecuteModules
static bool ExecuteModules(std::list<ImportModule*>& modules,
const ImportParameter& parameter,
Progress& progress,
const TypeConfigRef& typeConfig)
{
StopClock overAllTimer;
size_t currentStep=1;
for (const auto& module : modules) {
if (currentStep>=parameter.GetStartStep() &&
currentStep<=parameter.GetEndStep()) {
StopClock timer;
bool success;
progress.SetStep(std::string("Step #")+
NumberToString(currentStep)+
" - "+
module->GetDescription());
success=module->Import(typeConfig,
parameter,
progress);
timer.Stop();
progress.Info(std::string("=> ")+timer.ResultString()+" second(s)");
if (!success) {
progress.Error(std::string("Error while executing step '")+module->GetDescription()+"'!");
return false;
}
}
currentStep++;
}
overAllTimer.Stop();
progress.Info(std::string("=> ")+overAllTimer.ResultString()+" second(s)");
return true;
}
示例2: Import
bool Import(const ImportParameter& parameter,
Progress& progress)
{
// TODO: verify parameter
TypeConfigRef typeConfig(new TypeConfig());
std::list<ImportModule*> modules;
if (parameter.GetAreaWayMinMag()<=parameter.GetOptimizationMaxMag()) {
progress.Error("Area way index minimum magnification is <= than optimization max magnification");
}
progress.SetStep("Loading type config");
if (!typeConfig->LoadFromOSTFile(parameter.GetTypefile())) {
progress.Error("Cannot load type configuration!");
return false;
}
progress.Info("Number of types: "+NumberToString(typeConfig->GetTypes().size()));
progress.Info("Number of node types: "+NumberToString(typeConfig->GetNodeTypes().size())+" "+NumberToString(typeConfig->GetNodeTypeIdBytes())+" byte(s)");
progress.Info("Number of way types: "+NumberToString(typeConfig->GetWayTypes().size())+" "+NumberToString(typeConfig->GetWayTypeIdBytes())+" byte(s)");
progress.Info("Number of area types: "+NumberToString(typeConfig->GetAreaTypes().size())+" "+NumberToString(typeConfig->GetAreaTypeIdBytes())+" byte(s)");
typeConfig->RegisterNameTag("name",0);
typeConfig->RegisterNameTag("place_name",1);
/*
typeConfig->RegisterNameAltTag("name:ru",0);
typeConfig->RegisterNameAltTag("place_name:ru",1);
*/
/* 1 */
modules.push_back(new TypeDataGenerator());
/* 2 */
modules.push_back(new Preprocess());
/* 3 */
modules.push_back(new RawNodeIndexGenerator(AppendFileToDir(parameter.GetDestinationDirectory(),
"rawnodes.dat"),
AppendFileToDir(parameter.GetDestinationDirectory(),
"rawnode.idx")));
/* 4 */
modules.push_back(new RawWayIndexGenerator(AppendFileToDir(parameter.GetDestinationDirectory(),
"rawways.dat"),
AppendFileToDir(parameter.GetDestinationDirectory(),
"rawway.idx")));
/* 5 */
modules.push_back(new RawRelationIndexGenerator(AppendFileToDir(parameter.GetDestinationDirectory(),
"rawrels.dat"),
AppendFileToDir(parameter.GetDestinationDirectory(),
"rawrel.idx")));
/* 6 */
modules.push_back(new RelAreaDataGenerator());
/* 7 */
modules.push_back(new WayAreaDataGenerator());
/* 8 */
modules.push_back(new MergeAreaDataGenerator());
/* 9 */
modules.push_back(new MergeAreasGenerator());
/* 10 */
modules.push_back(new WayWayDataGenerator());
/* 11 */
modules.push_back(new OptimizeAreaWayIdsGenerator());
/* 12 */
modules.push_back(new NodeDataGenerator());
/* 13 */
modules.push_back(new SortNodeDataGenerator());
/* 14 */
modules.push_back(new SortWayDataGenerator());
/* 15 */
modules.push_back(new AreaNodeIndexGenerator());
/* 16 */
modules.push_back(new AreaWayIndexGenerator());
/* 17 */
modules.push_back(new AreaAreaIndexGenerator());
/* 18 */
modules.push_back(new WaterIndexGenerator());
/* 19 */
modules.push_back(new OptimizeAreasLowZoomGenerator());
/* 20 */
modules.push_back(new OptimizeWaysLowZoomGenerator());
/* 21 */
modules.push_back(new LocationIndexGenerator());
//.........这里部分代码省略.........