Build: enhance docker use, reducing build options, cleanup
[marnav.git] / src / marnav / nmea / r00.hpp
blob7efd5745dad55029157d3a6a44272a55663de84e
1 #ifndef MARNAV__NMEA__R00__HPP
2 #define MARNAV__NMEA__R00__HPP
4 #include <array>
5 #include <marnav/nmea/sentence.hpp>
6 #include <marnav/nmea/waypoint.hpp>
7 #include <marnav/utils/optional.hpp>
9 namespace marnav
11 namespace nmea
13 /// @brief R00 - Waypoints in active route
14 ///
15 /// @code
16 /// 1
17 /// |
18 /// $--R00,c---c,c---c,....*hh<CR><LF>
19 /// @endcode
20 ///
21 /// Field Number:
22 /// 1. Waypoint ID
23 ///
24 class r00 : public sentence
26 friend class detail::factory;
28 public:
29 constexpr static sentence_id ID = sentence_id::R00;
30 constexpr static const char * TAG = "R00";
31 constexpr static int max_waypoint_ids = 14;
33 r00();
34 r00(const r00 &) = default;
35 r00 & operator=(const r00 &) = default;
36 r00(r00 &&) = default;
37 r00 & operator=(r00 &&) = default;
39 protected:
40 r00(talker talk, fields::const_iterator first, fields::const_iterator last);
41 virtual void append_data_to(std::string &) const override;
43 private:
44 std::array<utils::optional<waypoint>, max_waypoint_ids> waypoint_id_;
46 void check_index(int index) const;
48 public:
49 utils::optional<waypoint> get_waypoint_id(int index) const;
51 void set_waypoint_id(int index, const waypoint & id);
56 #endif