1 #include <marnav/ais/message_08.hpp>
2 #include <marnav/ais/binary_001_11.hpp>
3 #include <marnav/ais/binary_200_10.hpp>
9 constexpr message_id
message_08::ID
;
10 constexpr std::size_t message_08::SIZE_BITS_HEAD
;
11 constexpr std::size_t message_08::SIZE_BITS_MAX
;
13 message_08::message_08()
18 message_08::message_08(const raw
& bits
)
21 if ((bits
.size() < SIZE_BITS_HEAD
) || (bits
.size() > SIZE_BITS_MAX
))
22 throw std::invalid_argument
{"invalid number of bits in ais/message_08"};
26 void message_08::read_data(const raw
& bits
)
28 get(bits
, repeat_indicator
);
33 payload
= raw
{bits
.begin() + SIZE_BITS_HEAD
, bits
.end()};
36 raw
message_08::get_data() const
38 raw
bits(SIZE_BITS_HEAD
);
40 bits
.set(type(), 0, 6);
41 set(bits
, repeat_indicator
);
51 void message_08::read_binary(binary_001_11
& m
) const
53 if (std::make_tuple(1, 11) != std::tie(dac
, fid
))
54 throw std::invalid_argument
{"invalid DAC/FID for Meteo/Hydro IMO236"};
58 void message_08::write_binary(const binary_001_11
& m
)
63 void message_08::read_binary(binary_200_10
& m
) const
65 if (std::make_tuple(200, 10) != std::tie(dac
, fid
))
66 throw std::invalid_argument
{
67 "invalid DAC/FID for Inland ship static voyage related data"};
71 void message_08::write_binary(const binary_200_10
& m
)