AIS: initialization of message fields modernized.
[marnav.git] / src / marnav / ais / message_10.hpp
blob1043743be0f4b38460352c2573d150ab4cb9f7f8
1 #ifndef __AIS__MESSAGE_10__HPP__
2 #define __AIS__MESSAGE_10__HPP__
4 #include <marnav/ais/message.hpp>
5 #include <marnav/geo/angle.hpp>
6 #include <marnav/utils/mmsi.hpp>
8 namespace marnav
10 namespace ais
13 /// @brief UTC/Date Inquiry
14 class message_10 : public message
16 public:
17 constexpr static const message_id ID = message_id::utc_and_date_inquiry;
18 constexpr static const int SIZE_BITS = 72;
20 message_10();
21 message_10(const message_10 &) = default;
22 message_10 & operator=(const message_10 &) = default;
24 virtual raw get_data() const override;
26 static std::unique_ptr<message> parse(const raw & bits);
28 protected:
29 void read_data(const raw & bits);
31 private:
32 unsigned int repeat_indicator = 0;
33 uint32_t mmsi = 0;
34 uint32_t dest_mmsi = 0;
36 public:
37 unsigned int get_repeat_indicator() const noexcept { return repeat_indicator; }
38 utils::mmsi get_mmsi() const noexcept { return utils::mmsi{mmsi}; }
39 utils::mmsi get_dest_mmsi() const noexcept { return utils::mmsi{dest_mmsi}; }
41 void set_repeat_indicator(unsigned int t) noexcept { repeat_indicator = t; }
42 void set_mmsi(const utils::mmsi & t) noexcept { mmsi = t; }
43 void set_dest_mmsi(const utils::mmsi & t) noexcept { mmsi = t; }
48 #endif