IdList<T>
A fast dictionary for objects with GUID keys. This type differs from Dictionary(Guid, T) by sacrificing memory for lookup performance. Adding entries may be slower and require more allocations, however finding entries ought to be slightly faster. This collection is not thread-safe and any modifying calls must be made from within a lock statement.
Type parameters:
| T |
Constructors
Properties
Methods
Add
#public void Add(T instance)
Add a new instance to this collection. If another instance with the same ID is already part of this collection, nothing will happen.
Parameters:
| instance (T) | Instance to add. |
Contains
#Test whether an instance with the same GUID as the argument exists within this collection.
Parameters:
| instance (T) |
Find
#Retrieve the instance which matches the ID.
Parameters:
| id (Guid) | ID key to search for. |
| instance (out T) | Instance associated with id, if any. |
Returns: True if an instance was found.
Set
#public void Set(T instance)
Add a new instance to this collection. Any existing instance with a matching key will be overwritten.
Parameters:
| instance (T) | Instance to add. |