本文整理汇总了C++中OrderedTaskPoint::is_intermediate方法的典型用法代码示例。如果您正苦于以下问题:C++ OrderedTaskPoint::is_intermediate方法的具体用法?C++ OrderedTaskPoint::is_intermediate怎么用?C++ OrderedTaskPoint::is_intermediate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OrderedTaskPoint
的用法示例。
在下文中一共展示了OrderedTaskPoint::is_intermediate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: append
bool
AbstractTaskFactory::insert(const OrderedTaskPoint &new_tp,
const unsigned position,
const bool auto_mutate)
{
if (position >= m_task.task_size())
return append(new_tp, auto_mutate);
if (auto_mutate) {
if (position == 0) {
if (m_task.has_start()) {
// old start must be mutated into an intermediate point
IntermediateTaskPoint* sp =
createIntermediate(m_task.getTaskPoint(0)->get_waypoint());
m_task.replace(*sp, 0);
delete sp;
}
if (validType(new_tp, 0)) {
return m_task.insert(new_tp, 0);
} else {
// candidate must be transformed into a startpoint
StartPoint* sp = createStart(new_tp.get_waypoint());
bool success = m_task.insert(*sp, 0);
delete sp;
return success;
}
} else {
if (new_tp.is_intermediate()) {
// candidate ok for direct insertion
return m_task.insert(new_tp, position);
} else {
// candidate must be transformed into a intermediatepoint
IntermediateTaskPoint* sp = createIntermediate(new_tp.get_waypoint());
bool success = m_task.insert(*sp, position);
delete sp;
return success;
}
}
}
return m_task.insert(new_tp, position);
}