Class BasicCache<T, K>
A simple cache implementation.
Inherited Members
Namespace: Evergine.Common.Helpers
Assembly: Evergine.Common.dll
Syntax
public class BasicCache<T, K>
Type Parameters
Name | Description |
---|---|
T | The item key type of the cache. |
K | The item value type of the cache. |
Constructors
BasicCache()
Initializes a new instance of the BasicCache<T, K> class.
Declaration
public BasicCache()
Fields
NewInstanceHandle
A handle to build 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)
Add 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()
Check if the cache items has expired.
Declaration
public void Check()
GetItem(T)
Gets an item.
Declaration
public K GetItem(T key)
Parameters
Type | Name | Description |
---|---|---|
T | key | The item key. |
Returns
Type | Description |
---|---|
K | The item. |