Click or drag to resize
ExpiringListT Class
Manages a self-expiring list of items.
Inheritance Hierarchy
SystemObject
  VirtualRadar.InterfaceExpiringCollectionT
    VirtualRadar.InterfaceExpiringListT

Namespace: VirtualRadar.Interface
Assembly: VirtualRadar.Interface (in VirtualRadar.Interface.dll) Version: 1.0.0.0 (1.0.0.0)
Syntax
public class ExpiringList<T> : ExpiringCollection<T>
where T : class

Type Parameters

T

The ExpiringListT type exposes the following members.

Constructors
Properties
  NameDescription
Public propertyAfterCheckForExpiredItemsDelegate
Gets or sets an optional delegate that is called after the check for expired items is made.
(Inherited from ExpiringCollectionTItem.)
Public propertyBeforeCheckForExpiredItemsDelegate
Gets or sets an optional delegate that is called before the check is made for expired items.
(Inherited from ExpiringCollectionTItem.)
Public propertyCount
Gets the current count of items in the list.
(Overrides ExpiringCollectionTItemCount.)
Public propertyCountChangedDelegate
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.)
Public propertyExpireMilliseconds
Gets or sets the minimum number of milliseconds that an item can remain within the list.
(Inherited from ExpiringCollectionTItem.)
Public propertyMillisecondsBetweenChecks
Gets or sets the minimum number of milliseconds to wait between checks for expiring items.
(Inherited from ExpiringCollectionTItem.)
Top
Methods
  NameDescription
Public methodAdd
Adds the item to the list.
Public methodAddOrRefresh
Adds the item if it is not already in the list. If it is in the list then its timestamp is refreshed to the current time.
Public methodAddRange
Adds a range of items to the list.
Public methodAddRangeOrRefresh
Adds a range of items to the list. Items that already exist in the list have their timestamps refreshed.
Public methodChangeIntervals
Changes the intervals for the expiration of items and the interval between checks.
(Inherited from ExpiringCollectionTItem.)
Public methodClear
Empties the list.
(Overrides ExpiringCollectionTItemClear.)
Public methodDispose
See interface docs.
(Inherited from ExpiringCollectionTItem.)
Protected methodDispose(Boolean)
Disposes of or finalises the object.
(Inherited from ExpiringCollectionTItem.)
Protected methodDoRemoveExpiredItems
See base docs.
(Overrides ExpiringCollectionTItemDoRemoveExpiredItems(DateTime).)
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Finalises the object.
(Inherited from ExpiringCollectionTItem.)
Public methodFind
Returns the item that matches the predicate or null if no such item exists.
Public methodFindAll
Returns all of the items that match the predicate or an empty list if no such items exist.
Public methodFindAllAndRefresh
Returns all of the items that match the predicate or an empty list if no such items exist. Refreshes the timestamps for all of the items returned.
Public methodFindAndRefresh
Returns the item that matches the predicate or null if no such item exists. Refreshes the timestamp for the item.
Protected methodFindCollectionItem
Finds the collection item for the item passed across.
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodHookHeartbeat
Hooks the heartbeat event. Must be called from within a lock.
(Inherited from ExpiringCollectionTItem.)
Public methodLock
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.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Protected methodOnCountChanged
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.)
Public methodRefreshAll
Refreshes the timestamps on every item in the list.
Public methodRemove
Removes the item from the list.
Public methodRemoveExpiredItems
Removes expired items.
(Inherited from ExpiringCollectionTItem.)
Public methodRemoveRange
Removes a range of items from the list.
Public methodSnapshot
Returns a clone of the contents of the list.
Public methodSnapshotAndRefresh
Returns a clone of every item in the list. Refreshes the timestamps on every item.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Protected methodUnhookHeartbeat
Unhooks the heartbeat service if hooked. Must be called from within a lock.
(Inherited from ExpiringCollectionTItem.)
Top
Fields
Remarks
When an item is added to this list it is given a timestamp. The items in the list are periodically checked, if they have been in the list for longer than ExpireMilliseconds then they are removed. This class is thread-safe.
See Also