Enhanced C#
Language of your choice: library documentation
|
A dictionary in which the values are weak. When a value has been garbage- collected, the dictionary acts as if the key is not present (except the Remove() method, which saves time by not checking whether the value is dead.) More...
A dictionary in which the values are weak. When a value has been garbage- collected, the dictionary acts as if the key is not present (except the Remove() method, which saves time by not checking whether the value is dead.)
This is implemented on top of a standard Dictionary. In order to allow the dictionary to be read safely while it is being enumerated, cleanup operations (to remove entries whose value has been garbage-collected) do not occur automatically during read operations. You can allow cleanups by calling AutoCleanup().
V | : | class |
Properties | |
override int | Count [get] |
Returns the number of dictionary entries. This value may be greater than the number of elements that are still alive. More... | |
Public Member Functions | |
bool | AutoCleanup () |
Periodically removes entries with garbage-collected values from the dictionary More... | |
void | Cleanup () |
Removes entries with garbage-collected values from the dictionary. More... | |
override void | Clear () |
override void | Add (K key, V value) |
override bool | ContainsKey (K key) |
override bool | Remove (K key) |
override bool | TryGetValue (K key, out V value) |
override IEnumerator < KeyValuePair< K, V > > | GetEnumerator () |
Protected Member Functions | |
override void | SetValue (K key, V value) |
|
inline |
Periodically removes entries with garbage-collected values from the dictionary
|
inline |
Removes entries with garbage-collected values from the dictionary.
|
get |
Returns the number of dictionary entries. This value may be greater than the number of elements that are still alive.