Class RefCountedLinkedSet<T>
Ref-counted MRU set: items are unique by equality; each Add increments a refcount, each token Dispose decrements it; item is removed when refcount hits zero. Enumeration yields items in MRU-first order (most recently added/updated first).
Inherited Members
Namespace: PoeShared.Scaffolding
Assembly: PoeShared.dll
Syntax
public class RefCountedLinkedSet<T> : IEnumerable<T>, IEnumerable
Type Parameters
Name | Description |
---|---|
T |
Constructors
Name | Description |
---|---|
RefCountedLinkedSet() | |
RefCountedLinkedSet(IEqualityComparer<T>?) |
Properties
Name | Description |
---|---|
Count | Total unique items currently present (i.e., with refcount > 0). |
Methods
Name | Description |
---|---|
Add(T?) | Adds an item (increments refcount). If it already exists, refcount is incremented and its recency is bumped to most-recent. Returns a token that decrements the refcount on Dispose(). |
Clear() | Removes everything regardless of refcounts. |
Contains(T) | Returns true if the item exists (refcount > 0). |
GetEnumerator() | Enumerates in MRU-first order (most-recent first). |