ChatRowLru
The use order of a bounded per-row cache: which row key to drop next.
| Group | libwidgets |
Declared in src/libs/libwidgets/widgets/chat/ChatRowLru.hpp.
Detailed description
ChatBubbleDelegate keeps a text document and a measured size for each row that it paints or measures. Without a bound, a stream of one million events held one document per row after one full layout (trove-parts §TPN-10). This class holds the keys of a fixed number of rows in the order of their last use. touch() puts a key first and returns the key that fell out of the bound, so the owner can delete its value.
The order holds keys only, never the values. Each operation takes constant time: a list holds the order and a hash finds a key in it.
See also ChatBubbleDelegate.