mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-11-16 03:14:27 +00:00
Extract weird range-of-entries algorithm out of view.
This commit is contained in:
@@ -68,7 +68,8 @@ struct AISRecentEntry {
|
||||
class AISRecentEntries {
|
||||
public:
|
||||
using ContainerType = std::list<AISRecentEntry>;
|
||||
|
||||
using RangeType = std::pair<ContainerType::const_iterator, ContainerType::const_iterator>;
|
||||
|
||||
void on_packet(const ais::Packet& packet);
|
||||
|
||||
ContainerType::const_reference front() const {
|
||||
@@ -89,6 +90,10 @@ public:
|
||||
return entries.empty();
|
||||
}
|
||||
|
||||
RangeType range_around(
|
||||
ContainerType::const_iterator, const size_t count
|
||||
) const;
|
||||
|
||||
private:
|
||||
ContainerType entries;
|
||||
const size_t entries_max = 64;
|
||||
|
||||
Reference in New Issue
Block a user