3 XCSoar Glide Computer - http://www.xcsoar.org/
4 Copyright (C) 2000-2013 The XCSoar Project
5 A detailed list of copyright holders can be found in the file "AUTHORS".
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; either version 2
10 of the License, or (at your option) any later version.
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 #ifndef DESERIALISER_HPP
23 #define DESERIALISER_HPP
25 #include "Task/Factory/TaskFactoryType.hpp"
26 #include "Task/Ordered/OrderedTaskBehaviour.hpp"
35 class ObservationZonePoint
;
38 * Class to serialise and de-serialise tasks to/from a #DataNode structure
44 const Waypoints
*waypoints
;
50 * @param the_node Node this Deserialiser will edit
51 * @param _waypoints a waypoint database to merge with (optional)
53 * @return Initialised object
55 Deserialiser(DataNode
&_node
, const Waypoints
*_waypoints
=nullptr)
56 :node(_node
), waypoints(_waypoints
) {}
59 * De-serialise a task (create a task to reflect the DataNode structure)
61 * @param data OrderedTask to serialise
63 void Deserialise(OrderedTask
&task
);
67 * Deserialise OrderedTaskBehaviour
69 * @param data Item to deserialise
71 void Deserialise(OrderedTaskBehaviour
&data
);
74 * Deserialise a Waypoint; client responsible for deletion
76 * @return Newly constructed Waypoint or nullptr on failure
78 Waypoint
* DeserialiseWaypoint();
81 * Deserialise a GeoPoint
83 * @param data Item to deserialise
85 void Deserialise(GeoPoint
&data
);
88 * Deserialise an ObservationZonePoint; client responsible for deletion
90 * @param wp Waypoint base of point
91 * @param is_turnpoint Whether the point is a turnpoint
93 * @return Newly constructed ObservationZonePoint or nullptr on failure
95 ObservationZonePoint
* DeserialiseOZ(const Waypoint
&wp
, bool is_turnpoint
);
98 * Deserialise a point, appending it to the task
100 * @param data OrderedTask to append to
102 void DeserialiseTaskpoint(OrderedTask
&data
);
105 AltitudeReference
GetHeightRef(const TCHAR
*nodename
) const;
106 TaskFactoryType
GetTaskFactoryType() const;