Class BasicCache<T, K>
A simple cache implementation.
Namespace: Evergine.Common.Helpers
Assembly: Evergine.Common.dll
Syntax
public class BasicCache<T, K>
Type Parameters
Name | Description |
---|---|
T | The type of the item key in the cache. |
K | The type of the item value in the cache. |
Constructors
BasicCache()
Initializes a new instance of the BasicCache<T, K> class.
Declaration
public BasicCache()
Fields
NewInstanceHandle
A handle to create a new instance.
Declaration
public BasicCache<T, K>.NewItemInstanceDelegate NewInstanceHandle
Field Value
Type | Description |
---|---|
BasicCache<T, K>.NewItemInstanceDelegate |
Properties
ExpirationTime
Gets or sets the expiration time.
Declaration
public TimeSpan ExpirationTime { get; set; }
Property Value
Type | Description |
---|---|
TimeSpan |
Methods
AddItem(T, K)
Adds an item to the cache.
Declaration
public void AddItem(T key, K item)
Parameters
Type | Name | Description |
---|---|---|
T | key | The key. |
K | item | The item. |
Check()
Checks if the cache items have expired.
Declaration
public void Check()
GetItem(T)
Gets an item.
Declaration
public K GetItem(T key)
Parameters
Type | Name | Description |
---|---|---|
T | key | The key of the item. |
Returns
Type | Description |
---|---|
K | The item. |