mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-01-11 23:39:29 -05:00
Return updated AIS RecentEntry.
This commit is contained in:
parent
19e3b273ad
commit
c4f7d9bf54
@ -133,7 +133,7 @@ void AISRecentEntry::update(const ais::Packet& packet) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AISRecentEntries::on_packet(const ais::Packet& packet) {
|
const AISRecentEntry& AISRecentEntries::on_packet(const ais::Packet& packet) {
|
||||||
const auto source_id = packet.source_id();
|
const auto source_id = packet.source_id();
|
||||||
auto matching_recent = find_by_mmsi(source_id);
|
auto matching_recent = find_by_mmsi(source_id);
|
||||||
if( matching_recent != std::end(entries) ) {
|
if( matching_recent != std::end(entries) ) {
|
||||||
@ -145,7 +145,10 @@ void AISRecentEntries::on_packet(const ais::Packet& packet) {
|
|||||||
truncate_entries();
|
truncate_entries();
|
||||||
}
|
}
|
||||||
|
|
||||||
entries.front().update(packet);
|
auto& entry = entries.front();
|
||||||
|
entry.update(packet);
|
||||||
|
|
||||||
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
AISRecentEntries::ContainerType::const_iterator AISRecentEntries::find_by_mmsi(const ais::MMSI key) const {
|
AISRecentEntries::ContainerType::const_iterator AISRecentEntries::find_by_mmsi(const ais::MMSI key) const {
|
||||||
|
@ -75,7 +75,7 @@ public:
|
|||||||
using ContainerType = std::list<AISRecentEntry>;
|
using ContainerType = std::list<AISRecentEntry>;
|
||||||
using RangeType = std::pair<ContainerType::const_iterator, ContainerType::const_iterator>;
|
using RangeType = std::pair<ContainerType::const_iterator, ContainerType::const_iterator>;
|
||||||
|
|
||||||
void on_packet(const ais::Packet& packet);
|
const AISRecentEntry& on_packet(const ais::Packet& packet);
|
||||||
|
|
||||||
ContainerType::const_reference front() const {
|
ContainerType::const_reference front() const {
|
||||||
return entries.front();
|
return entries.front();
|
||||||
|
Loading…
Reference in New Issue
Block a user