1 #ifndef __UTILS__MMSI__HPP__
2 #define __UTILS__MMSI__HPP__
11 /// @brief Represents a MMSI (Maritime Mobile Service Identiy).
13 /// @see http://www.navcen.uscg.gov/?pageName=mtMmsi
15 /// @note Not all variations and criterias are implemented.
20 using value_type
= uint32_t;
22 static constexpr value_type initial_value
= 0;
26 explicit mmsi(value_type t
) noexcept
: value(t
) {}
28 mmsi(const mmsi
&) = default;
29 mmsi(mmsi
&&) noexcept
= default;
30 mmsi
& operator=(const mmsi
&) = default;
31 mmsi
& operator=(mmsi
&&) noexcept
= default;
33 bool operator==(const mmsi
& other
) const;
34 bool operator!=(const mmsi
& other
) const;
36 operator value_type() const { return value
; }
38 value_type
regular_mid() const;
39 value_type
regular_id() const;
40 value_type
group_mid() const;
41 value_type
group_id() const;
42 value_type
coastal_mid() const;
43 value_type
coastal_id() const;
44 value_type
auxiliary_mid() const;
45 value_type
auxiliary_id() const;
46 value_type
mob_mid() const;
47 value_type
mob_id() const;
49 bool is_regular() const;
50 bool is_group() const;
51 bool is_coastal() const;
52 bool is_all_coastal_for(value_type mid
) const;
53 bool is_all_coastal() const;
54 bool is_auxiliary() const;
55 bool is_ais_aids() const;
56 bool is_sar_aircraft() const;
59 bool is_epirb_ais() const;
62 value_type value
= initial_value
;