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


C++ TaskManager::reset方法代码示例

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


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

示例1: test_task_manip


//.........这里部分代码省略.........
    return false;
  }

  task_report(task_manager, "# removing tp 0\n");
  if (!fact.remove(0)) {
    return false;
  }

  task_report(task_manager, "# removing tp -1 (illegal)\n");
  if (fact.remove(0-1)) {
    return false;
  }

  task_report(task_manager, "# removing tp 50 (illegal)\n");
  if (fact.remove(50)) {
    return false;
  }

  OrderedTaskPoint *tp;
  const Waypoint *wp;

  task_report(task_manager, "# inserting at 3\n");
  wp = waypoints.lookup_id(3);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.insert(tp,3)) return false;
  }

  task_report(task_manager, "# auto-replacing at 2 (no morph)\n");
  wp = waypoints.lookup_id(9);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.replace(tp,2)) return false;
  }

  task_report(task_manager, "# auto-replacing at 2 (morph)\n");
  wp = waypoints.lookup_id(9);
  if (wp) {
    tp = fact.createStart(*wp);
    if (!fact.replace(tp,2)) return false;
  }

  task_report(task_manager, "# auto-replacing at 0 (morph this)\n");
  wp = waypoints.lookup_id(12);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.replace(tp,0)) return false;
  }

  task_report(task_manager, "# auto-replacing at end (morph this)\n");
  wp = waypoints.lookup_id(14);
  if (wp) {
    tp = fact.createIntermediate(AbstractTaskFactory::AST_CYLINDER,*wp);
    if (!fact.replace(tp,task_manager.task_size()-1)) return false;
  }

  task_report(task_manager, "# removing finish point\n");
  if (!fact.remove(task_manager.task_size()-1)) {
    return false;
  }

  task_report(task_manager, "# inserting at 50 (equivalent to append)\n");
  wp = waypoints.lookup_id(8);
  if (wp) {
    tp = fact.createFinish(*wp);
    if (!fact.insert(tp,50)) return false;
  }

  task_report(task_manager, "# inserting at 0 (morph this)\n");
  wp = waypoints.lookup_id(3);
  if (wp) {
    tp = fact.createFinish(*wp);
    if (!fact.insert(tp,0)) return false;
  }

  task_report(task_manager, "# inserting at 2 (morph this)\n");
  wp = waypoints.lookup_id(4);
  if (wp) {
    tp = fact.createStart(*wp);
    if (!fact.insert(tp,2)) return false;
  }

  task_report(task_manager, "# inserting at 2 (direct)\n");
  wp = waypoints.lookup_id(6);
  if (wp) {
    tp = fact.createIntermediate(*wp);
    if (!fact.insert(tp,2,false)) return false;
  }

  task_report(task_manager, "# checking task\n");

  if (task_manager.check_ordered_task()) {
    task_manager.reset();
    task_manager.setActiveTaskPoint(0);
    task_manager.resume();
  } else {
    return false;
  }
  return true;
}
开发者ID:galippi,项目名称:xcsoar,代码行数:101,代码来源:harness_task.cpp


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