예제 #1
0
void 
Serialiser::Serialise(const OrderedTask &task)
{
  node.SetAttribute(_T("type"), GetTaskFactoryType(task.GetFactoryType()));
  Serialise(task.GetOrderedTaskBehaviour());
  mode_optional_start = false;
  task.AcceptTaskPointVisitor(*this);
  mode_optional_start = true;
  task.AcceptStartPointVisitor(*this);
}
예제 #2
0
void
SaveTask(WritableDataNode &node, const OrderedTask &task)
{
  node.SetAttribute(_T("type"), GetTaskFactoryType(task.GetFactoryType()));
  Serialise(node, task.GetOrderedTaskSettings());

  for (const auto &tp : task.GetPoints())
    Serialise(node, tp, false);

  for (const auto &tp : task.GetOptionalStartPoints())
    Serialise(node, tp, true);
}
예제 #3
0
void 
Serialiser::Serialise(const OrderedTask &task)
{
  node.SetAttribute(_T("type"), GetTaskFactoryType(task.GetFactoryType()));
  Serialise(task.GetOrderedTaskBehaviour());
  mode_optional_start = false;

  for (const auto &tp : task.GetPoints())
    Serialise(tp);

  mode_optional_start = true;
  for (const auto &tp : task.GetOptionalStartPoints())
    Serialise(tp);
}
예제 #4
0
void 
Deserialiser::Deserialise(OrderedTask &task)
{
  task.Clear();
  task.SetFactory(GetTaskFactoryType());
  task.Reset();

  OrderedTaskBehaviour beh = task.GetOrderedTaskBehaviour();
  Deserialise(beh);
  task.SetOrderedTaskBehaviour(beh);

  const DataNode::List children = node.ListChildrenNamed(_T("Point"));
  for (const auto &i : children) {
    std::unique_ptr<DataNode> point_node(i);
    Deserialiser pser(*point_node, waypoints);
    pser.DeserialiseTaskpoint(task);
  }
}
예제 #5
0
void
LoadTask(OrderedTask &task, const ConstDataNode &node,
         const Waypoints *waypoints)
{
  task.Clear();
  task.SetFactory(GetTaskFactoryType(node));
  task.Reset();

  OrderedTaskSettings beh = task.GetOrderedTaskSettings();
  Deserialise(beh, node);
  task.SetOrderedTaskSettings(beh);

  const auto children = node.ListChildrenNamed(_T("Point"));
  for (const auto &i : children) {
    std::unique_ptr<ConstDataNode> point_node(i);
    DeserialiseTaskpoint(task, *point_node, waypoints);
  }
}