Exemple #1
0
bool
OrderedTask::ScanStartFinish()
{
  /// @todo also check there are not more than one start/finish point
  if (task_points.empty()) {
    taskpoint_start = nullptr;
    taskpoint_finish = nullptr;
    return false;
  }

  taskpoint_start = task_points[0]->GetType() == TaskPointType::START
    ? (StartPoint *)task_points[0]
    : nullptr;

  taskpoint_finish = task_points.size() > 1 &&
    task_points[task_points.size() - 1]->GetType() == TaskPointType::FINISH
    ? (FinishPoint *)task_points[task_points.size() - 1]
    : nullptr;

  return HasStart() && HasFinish();
}
Exemple #2
0
bool
OrderedTask::scan_start_finish()
{
  /// @todo also check there are not more than one start/finish point
  if (!task_points.size()) {
    taskpoint_start = NULL;
    taskpoint_finish = NULL;
    return false;
  }

  taskpoint_start = task_points[0]->GetType() == TaskPoint::START
    ? (StartPoint *)task_points[0]
    : NULL;

  taskpoint_finish = task_points.size() > 1 &&
    task_points[task_points.size() - 1]->GetType() == TaskPoint::FINISH
    ? (FinishPoint *)task_points[task_points.size() - 1]
    : NULL;

  return HasStart() && HasFinish();
}