#ifndef GEONET_ADDRESS_HPP_MB8J1IVQ #define GEONET_ADDRESS_HPP_MB8J1IVQ #include #include #include #include #include #include namespace vanetza { namespace geonet { class Address { public: static constexpr std::size_t length_bytes = 8; Address(); explicit Address(const MacAddress&); bool is_manually_configured() const { return m_manually_configured; } void is_manually_configured(bool flag) { m_manually_configured = flag; } StationType station_type() const { return m_station_type; } void station_type(StationType type) { m_station_type = type; } BitNumber country_code() const { return m_country_code; } void country_code(BitNumber country) { m_country_code = country; } const MacAddress& mid() const { return m_mid; } void mid(const MacAddress& mid) { m_mid = mid; } bool operator==(const Address& other) const; bool operator!=(const Address& other) const; private: bool m_manually_configured; // 1 bit StationType m_station_type; // 5 bit BitNumber m_country_code; // 10 bit (deprecated since 1.3.1) MacAddress m_mid; // 48 bit }; void serialize(const Address&, OutputArchive&); void deserialize(Address&, InputArchive&); } // namespace geonet } // namespace vanetza namespace std { template<> struct hash { size_t operator()(const vanetza::geonet::Address& addr) const; }; } // namespace std #endif /* GEONET_ADDRESS_HPP_MB8J1IVQ */