Extract weird range-of-entries algorithm out of view.

This commit is contained in:
Jared Boone 2016-01-14 11:49:19 -08:00
parent f8d9cb318d
commit b1707298b7
2 changed files with 30 additions and 17 deletions

View file

@ -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;