Interface IClassObjectCache<TKey, TValue>
An interface for caching objects according to class info and object info.
Inherited Members
Namespace: Microsoft.XboxStudios.GameStateTracker.Cache
Assembly: GameStateTracker.Abstractions.dll
Syntax
public interface IClassObjectCache<TKey, TValue> : IObjectCache<TKey, TValue>, ICollection<TValue>, IEnumerable<TValue>, IDictionary<TKey, TValue>, ICollection<KeyValuePair<TKey, TValue>>, IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable
Type Parameters
Name | Description |
---|---|
TKey | The info type. |
TValue | The object type. |
Methods
View SourceClearClass(TKey)
Removes all matching objects from the cache.
Declaration
void ClearClass(TKey classKey)
Parameters
Type | Name | Description |
---|---|---|
TKey | classKey | The object info. |
GetClassAge(TKey)
Gets the age of a set of objects in the cache.
Declaration
TimeSpan? GetClassAge(TKey classKey)
Parameters
Type | Name | Description |
---|---|---|
TKey | classKey | The objects to search for. |
Returns
Type | Description |
---|---|
TimeSpan? | The time since the objects were last refreshed. |
GetClassAge(TKey, DateTime)
Gets the age of a set of objects in the cache.
Declaration
TimeSpan? GetClassAge(TKey classKey, DateTime now)
Parameters
Type | Name | Description |
---|---|---|
TKey | classKey | The objects to search for. |
DateTime | now | The current time to compare to. |
Returns
Type | Description |
---|---|
TimeSpan? | The time since the objects were last refreshed. |
RefreshClass(TKey)
Updates the age of all matching objects in the cache.
Declaration
void RefreshClass(TKey classKey)
Parameters
Type | Name | Description |
---|---|---|
TKey | classKey | The objects to search for. |
RefreshClass(TKey, DateTime)
Updates the age of all matching objects in the cache.
Declaration
void RefreshClass(TKey classKey, DateTime now)
Parameters
Type | Name | Description |
---|---|---|
TKey | classKey | The objects to search for. |
DateTime | now | The current time to set. |