gcc_pure OrderedTaskPoint &GetPoint(const unsigned i) { assert(i < task_points.size()); assert(task_points[i] != nullptr); return *task_points[i]; }
gcc_pure const OrderedTaskPoint &GetPoint(const unsigned i) const { assert(i < task_points.size()); assert(task_points[i] != NULL); return *task_points[i]; }
void OrderedTask::CheckDuplicateWaypoints(Waypoints& waypoints, OrderedTaskPointVector& points, const bool is_task) { for (auto begin = points.cbegin(), end = points.cend(), i = begin; i != end; ++i) { auto wp = waypoints.CheckExistsOrAppend((*i)->GetWaypointPtr()); const OrderedTaskPoint *new_tp = (*i)->Clone(task_behaviour, ordered_settings, std::move(wp)); if (is_task) Replace(*new_tp, std::distance(begin, i)); else ReplaceOptionalStart(*new_tp, std::distance(begin, i)); delete new_tp; } }
/* virtual methods from class TaskInterface */ virtual unsigned TaskSize() const override { return task_points.size(); }
/** * returns optional start point * * @param pos optional start point index * @return NULL if index out of range, else optional start point */ gcc_pure const OrderedTaskPoint &GetOptionalStartPoint(unsigned i) const { assert(i < optional_start_points.size()); return *optional_start_points[i]; }
/** * @return number of optional start poitns */ gcc_pure unsigned GetOptionalStartPointCount() const { return optional_start_points.size(); }
/** * Check whether the task point with the specified index exists. */ gcc_pure bool IsValidIndex(unsigned i) const { return i < task_points.size(); }
/** * Returns true if there are optional start points. */ gcc_pure bool HasOptionalStarts() const { return !optional_start_points.empty(); }
/** * Retrieve task point by sequence index * * @param index Index of task point sequence * * @return OrderedTaskPoint at index */ gcc_pure const OrderedTaskPoint &GetTaskPoint(const unsigned index) const { assert(index < task_points.size()); return *task_points[index]; }
/** * @return number of optional start poitns */ gcc_pure unsigned optional_start_points_size() { return optional_start_points.size(); }