当前位置: 首页>>代码示例>>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


//.........这里部分代码省略.........
    }

    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.LookupId(3);
    if (wp) {
        tp = fact.CreateIntermediate(TaskPointFactoryType::AST_CYLINDER,*wp);
        if (!fact.Insert(*tp,3)) return false;
        delete tp;
    }

    task_report(task_manager, "# auto-replacing at 2 (no morph)\n");
    wp = waypoints.LookupId(9);
    if (wp) {
        tp = fact.CreateIntermediate(TaskPointFactoryType::AST_CYLINDER,*wp);
        if (!fact.Replace(*tp,2)) return false;
        delete tp;
    }

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

    task_report(task_manager, "# auto-replacing at 0 (morph this)\n");
    wp = waypoints.LookupId(12);
    if (wp) {
        tp = fact.CreateIntermediate(TaskPointFactoryType::AST_CYLINDER,*wp);
        if (!fact.Replace(*tp,0)) return false;
        delete tp;
    }

    task_report(task_manager, "# auto-replacing at end (morph this)\n");
    wp = waypoints.LookupId(14);
    if (wp) {
        tp = fact.CreateIntermediate(TaskPointFactoryType::AST_CYLINDER,*wp);
        if (!fact.Replace(*tp,task_manager.TaskSize()-1)) return false;
        delete tp;
    }

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

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

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

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

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

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

    fact.UpdateStatsGeometry();

    if (task_manager.CheckOrderedTask()) {
        task_manager.Reset();
        task_manager.SetActiveTaskPoint(0);
        task_manager.Resume();
    } else {
        return false;
    }
    return true;
}
开发者ID:j-konopka,项目名称:XCSoar-TE,代码行数:101,代码来源:harness_task.cpp


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