ExpiringDictionaryTKey, TValue Class |
Namespace: VirtualRadar.Interface
public class ExpiringDictionary<TKey, TValue> : ExpiringCollection<TValue> where TValue : class
The ExpiringDictionaryTKey, TValue type exposes the following members.
Name | Description | |
---|---|---|
ExpiringDictionaryTKey, TValue |
Creates a new object.
|
Name | Description | |
---|---|---|
AfterCheckForExpiredItemsDelegate |
Gets or sets an optional delegate that is called after the check for expired items is made.
(Inherited from ExpiringCollectionTItem.) | |
BeforeCheckForExpiredItemsDelegate |
Gets or sets an optional delegate that is called before the check is made for expired items.
(Inherited from ExpiringCollectionTItem.) | |
Count |
Gets the current count of items in the dictionary.
(Overrides ExpiringCollectionTItemCount.) | |
CountChangedDelegate |
Gets or sets an optional delegate that is called when the count changes. The new count is
passed to the delegate. The list is locked to the calling thread while the delegate is running.
The delegate will occasionally be called on a background thread.
(Inherited from ExpiringCollectionTItem.) | |
ExpireMilliseconds |
Gets or sets the minimum number of milliseconds that an item can remain within the list.
(Inherited from ExpiringCollectionTItem.) | |
GetExpiredItemsDelegate |
Gets or sets an optional delegate that returns the collection of the keys of expired items. If this delegate is present
then it is always used in preference to the timestamps attached to the item and the Refresh methods will have no effect.
| |
MillisecondsBetweenChecks |
Gets or sets the minimum number of milliseconds to wait between checks for expiring items.
(Inherited from ExpiringCollectionTItem.) |
Name | Description | |
---|---|---|
Add |
Adds an item to the dictionary.
| |
ChangeIntervals |
Changes the intervals for the expiration of items and the interval between checks.
(Inherited from ExpiringCollectionTItem.) | |
Clear |
Empties the dictionary.
(Overrides ExpiringCollectionTItemClear.) | |
Dispose |
See interface docs.
(Inherited from ExpiringCollectionTItem.) | |
Dispose(Boolean) |
Disposes of or finalises the object.
(Inherited from ExpiringCollectionTItem.) | |
DoRemoveExpiredItems |
See base docs.
(Overrides ExpiringCollectionTItemDoRemoveExpiredItems(DateTime).) | |
Equals | (Inherited from Object.) | |
Finalize |
Finalises the object.
(Inherited from ExpiringCollectionTItem.) | |
Find |
Finds the first value that matches the predicate passed across or null if no
such value could be found.
| |
FindAll |
Returns a list of all values that match the predicate passed across.
| |
FindAllAndRefresh |
Returns a list of all values that match the predicate passed across. Refreshes the
timestamps for all items returned.
| |
FindAndRefresh |
Finds the first value that matches the predicate passed across or null if no
such value could be found. Refreshes the timestamp on the value if it could be found.
| |
GetAndRefreshOrCreate |
Returns the item for the key passed across or calls the create method to create a new item and add it to the dictionary.
If the item already exists then its timestamp is refreshed.
| |
GetForKey |
Returns the item for the key passed across. Returns null if the key is no longer in the dictionary.
| |
GetForKeyAndRefresh |
Returns the item for the key passed across. Returns null if the key is no longer in the dictionary.
Refreshes the item's timestamp.
| |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetOrCreate |
Returns the item for the key passed across or calls the create method to create a new item and add it to the dictionary.
| |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
HookHeartbeat |
Hooks the heartbeat event. Must be called from within a lock.
(Inherited from ExpiringCollectionTItem.) | |
Lock |
Calls the action passed across with the list locked. Do not perform an action that will attempt
to lock the list from another thread, it will block.
(Inherited from ExpiringCollectionTItem.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
OnCountChanged |
Called by the derivee to inform the owner of the collection that the count has changed. Always call this
from within a lock.
(Inherited from ExpiringCollectionTItem.) | |
RefreshAll |
Refreshes all of the timestamps in the dictionary.
| |
RemoveExpiredItems |
Removes expired items.
(Inherited from ExpiringCollectionTItem.) | |
RemoveIfExists |
Removes the item for the key passed across. Does nothing if the key does not exist.
| |
Snapshot |
Returns a snapshot of all of the key-value pairs in the dictionary.
| |
SnapshotAndRefresh |
Returns a snapshot of all of the key-value pairs in the dictionary and refreshes the timestamps on all of them.
| |
ToString | Returns a string that represents the current object. (Inherited from Object.) | |
UnhookHeartbeat |
Unhooks the heartbeat service if hooked. Must be called from within a lock.
(Inherited from ExpiringCollectionTItem.) | |
Upsert |
Adds or updates an item in the dictionary. If the key is already in use then the value is overwritten
but the timestamp is not refreshed.
| |
UpsertAndRefresh |
Adds or updates an item in the dictionary. If the key is already in use then the value is overwritten and
the timestamp is refreshed.
| |
UpsertRange |
Adds or updates a range of items. If an item exists then it is updated but its timestamp is not refreshed.
| |
UpsertRangeAndRefresh |
Adds or updates a range of items. If an item exists then it is updated and its timestamp is refreshed.
|
Name | Description | |
---|---|---|
_Clock |
The clock that provides timestamps.
(Inherited from ExpiringCollectionTItem.) | |
_SyncLock |
The lock object that controls access to the other fields.
(Inherited from ExpiringCollectionTItem.) |