void remember(const ConsoleEntry &entry)
Stores an entry and forgets the oldest ones beyond capacity. The caller holds the lock.
std::deque< std::string > _order
UIDs oldest first, used to forget the oldest entry.
std::mutex _mutex
Guards the entries and their order.
ConsoleEntry add(ConsoleEntry entry)
Adds an entry, or returns the one already held under the same UID.
std::unordered_map< std::string, std::set< std::pair< ProcessKind, std::uint32_t > > > _receipts
std::optional< Confirmation > confirm(ConsoleEntry fallback, ProcessKind sender=PROCESS_KIND_UNSPECIFIED, std::uint32_t senderId=0)
Records that a command was received. A direct entry becomes received. A multicast entry becomes recei...
std::size_t size() const
Number of entries currently held.
std::unordered_map< std::string, ConsoleEntry > _entries
Entries by UID.
EntryList(std::size_t capacity=5000)
Creates an empty list.