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


C++ StopClock::Stop方法代码示例

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


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

示例1: GetOptimizeAreasLowZoom

  OptimizeAreasLowZoomRef Database::GetOptimizeAreasLowZoom() const
  {
    std::lock_guard<std::mutex> guard(optimizeAreasMutex);

    if (!IsOpen()) {
      return NULL;
    }

    if (!optimizeAreasLowZoom) {
      optimizeAreasLowZoom=std::make_shared<OptimizeAreasLowZoom>();

      StopClock timer;

      if (!optimizeAreasLowZoom->Open(typeConfig,
                                      path)) {
        log.Error() << "Cannot load optimize areas low zoom index!";
        optimizeAreasLowZoom=NULL;

        return NULL;
      }


      timer.Stop();

      log.Debug() << "Opening OptimizeAreasLowZoom: " << timer.ResultString();
    }

    return optimizeAreasLowZoom;
  }
开发者ID:camiloMS,项目名称:libosmscout,代码行数:29,代码来源:Database.cpp

示例2: GetWaterIndex

  WaterIndexRef Database::GetWaterIndex() const
  {
    std::lock_guard<std::mutex> guard(waterIndexMutex);

    if (!IsOpen()) {
      return NULL;
    }

    if (!waterIndex) {
      waterIndex=std::make_shared<WaterIndex>();

      StopClock timer;

      if (!waterIndex->Open(path)) {
        log.Error() << "Cannot load water index!";
        waterIndex=NULL;

        return NULL;
      }

      timer.Stop();

      log.Debug() << "Opening WaterIndex: " << timer.ResultString();
    }

    return waterIndex;
  }
开发者ID:camiloMS,项目名称:libosmscout,代码行数:27,代码来源:Database.cpp

示例3: GetLocationIndex

  LocationIndexRef Database::GetLocationIndex() const
  {
    std::lock_guard<std::mutex> guard(locationIndexMutex);

    if (!IsOpen()) {
      return NULL;
    }

    if (!locationIndex) {
      locationIndex=std::make_shared<LocationIndex>();

      StopClock timer;

      if (!locationIndex->Load(path)) {
        log.Error() << "Cannot load location index!";
        locationIndex=NULL;

        return NULL;
      }

      timer.Stop();

      log.Debug() << "Opening LocationIndex: " << timer.ResultString();
    }

    return locationIndex;
  }
开发者ID:camiloMS,项目名称:libosmscout,代码行数:27,代码来源:Database.cpp

示例4: GetAreaWayIndex

  AreaWayIndexRef Database::GetAreaWayIndex() const
  {
    std::lock_guard<std::mutex> guard(areaWayIndexMutex);

    if (!IsOpen()) {
      return NULL;
    }

    if (!areaWayIndex) {
      areaWayIndex=std::make_shared<AreaWayIndex>();

      StopClock timer;

      if (!areaWayIndex->Open(typeConfig,
                              path)) {
        log.Error() << "Cannot load area way index!";
        areaWayIndex=NULL;

        return NULL;
      }

      timer.Stop();

      log.Debug() << "Opening AreaWayIndex: " << timer.ResultString();
    }

    return areaWayIndex;
  }
开发者ID:camiloMS,项目名称:libosmscout,代码行数:28,代码来源:Database.cpp

示例5: GetAreaAreaIndex

  AreaAreaIndexRef Database::GetAreaAreaIndex() const
  {
    std::lock_guard<std::mutex> guard(areaAreaIndexMutex);

    if (!IsOpen()) {
      return NULL;
    }

    if (!areaAreaIndex) {
      areaAreaIndex=std::make_shared<AreaAreaIndex>(parameter.GetAreaAreaIndexCacheSize());

      StopClock timer;

      if (!areaAreaIndex->Open(path)) {
        log.Error() << "Cannot load area area index!";
        areaAreaIndex=NULL;

        return NULL;
      }

      timer.Stop();

      log.Debug() << "Opening AreaAreaIndex: " << timer.ResultString();
    }

    return areaAreaIndex;
  }
开发者ID:camiloMS,项目名称:libosmscout,代码行数:27,代码来源:Database.cpp

示例6: GetWayDataFile

  WayDataFileRef Database::GetWayDataFile() const
  {
    std::lock_guard<std::mutex> guard(wayDataFileMutex);

    if (!IsOpen()) {
      return NULL;
    }

    if (!wayDataFile) {
      wayDataFile=std::make_shared<WayDataFile>();
    }

    if (!wayDataFile->IsOpen()) {
      StopClock timer;

      if (!wayDataFile->Open(typeConfig,
                             path,
                             FileScanner::LowMemRandom,
                             true)) {
        log.Error() << "Cannot open 'ways.dat'!";
        return NULL;
      }

      timer.Stop();

      log.Debug() << "Opening WayDataFile: " << timer.ResultString();
    }

    return wayDataFile;
  }
开发者ID:camiloMS,项目名称:libosmscout,代码行数:30,代码来源:Database.cpp

示例7: 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;
  }
开发者ID:jojva,项目名称:libosmscout,代码行数:41,代码来源:Import.cpp

示例8: GetAreaByOffset

  bool Database::GetAreaByOffset(const FileOffset& offset,
                                 AreaRef& area) const
  {
    AreaDataFileRef areaDataFile=GetAreaDataFile();

    if (!areaDataFile) {
      return false;
    }

    StopClock time;

    bool result=areaDataFile->GetByOffset(offset,area);

    time.Stop();

    if (time.GetMilliseconds()>100) {
      log.Warn() << "Retrieving areas by offset took " << time.ResultString();
    }

    return result;
  }
开发者ID:camiloMS,项目名称:libosmscout,代码行数:21,代码来源:Database.cpp

示例9: GetNodesByOffset

  bool Database::GetNodesByOffset(const std::set<FileOffset>& offsets,
                                  std::unordered_map<FileOffset,NodeRef>& dataMap) const
  {
    NodeDataFileRef nodeDataFile=GetNodeDataFile();

    if (!nodeDataFile) {
      return false;
    }

    StopClock time;

    bool result=nodeDataFile->GetByOffset(offsets,dataMap);

    time.Stop();

    if (time.GetMilliseconds()>100) {
      log.Warn() << "Retrieving nodes by offset took " << time.ResultString();
    }

    return result;
  }
开发者ID:camiloMS,项目名称:libosmscout,代码行数:21,代码来源:Database.cpp

示例10: GetNodeByOffset

  bool Database::GetNodeByOffset(const FileOffset& offset,
                                 NodeRef& node) const
  {
    NodeDataFileRef nodeDataFile=GetNodeDataFile();

    if (!nodeDataFile) {
      return false;
    }

    StopClock time;

    bool result=nodeDataFile->GetByOffset(offset,node);

    time.Stop();

    if (time.GetMilliseconds()>100) {
      log.Warn() << "Retrieving nodes by offset took " << time.ResultString();
    }

    return result;
  }
开发者ID:camiloMS,项目名称:libosmscout,代码行数:21,代码来源:Database.cpp


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