Show / Hide Table of Contents

Interface IObjectCache<TKey, TValue>

An interface for caching objects.

Inherited Members
ICollection<TValue>.Add(TValue)
ICollection<TValue>.Clear()
ICollection<TValue>.Contains(TValue)
ICollection<TValue>.CopyTo(TValue[], int)
ICollection<TValue>.Remove(TValue)
ICollection<TValue>.Count
ICollection<TValue>.IsReadOnly
IEnumerable<TValue>.GetEnumerator()
IDictionary<TKey, TValue>.Add(TKey, TValue)
IDictionary<TKey, TValue>.ContainsKey(TKey)
IDictionary<TKey, TValue>.Remove(TKey)
IDictionary<TKey, TValue>.TryGetValue(TKey, out TValue)
IDictionary<TKey, TValue>.this[TKey]
IDictionary<TKey, TValue>.Keys
IDictionary<TKey, TValue>.Values
ICollection<KeyValuePair<TKey, TValue>>.Add(KeyValuePair<TKey, TValue>)
ICollection<KeyValuePair<TKey, TValue>>.Clear()
ICollection<KeyValuePair<TKey, TValue>>.Contains(KeyValuePair<TKey, TValue>)
ICollection<KeyValuePair<TKey, TValue>>.CopyTo(KeyValuePair<TKey, TValue>[], int)
ICollection<KeyValuePair<TKey, TValue>>.Remove(KeyValuePair<TKey, TValue>)
ICollection<KeyValuePair<TKey, TValue>>.Count
ICollection<KeyValuePair<TKey, TValue>>.IsReadOnly
IEnumerable<KeyValuePair<TKey, TValue>>.GetEnumerator()
Namespace: Microsoft.XboxStudios.GameStateTracker.Cache
Assembly: GameStateTracker.Abstractions.dll
Syntax
public interface 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 Source

GetObjectAge(TKey)

Gets the age of an object in the cache.

Declaration
TimeSpan? GetObjectAge(TKey info)
Parameters
Type Name Description
TKey info

The object info.

Returns
Type Description
TimeSpan?

The time since the object was last refreshed.

View Source

GetObjectAge(TKey, DateTime)

Gets the age of an object in the cache.

Declaration
TimeSpan? GetObjectAge(TKey info, DateTime now)
Parameters
Type Name Description
TKey info

The object info.

DateTime now

The current time to compare to.

Returns
Type Description
TimeSpan?

The time since the object was last refreshed.

View Source

RefreshObject(TKey)

Updates the age of an object in the cache.

Declaration
void RefreshObject(TKey info)
Parameters
Type Name Description
TKey info

The object info.

View Source

RefreshObject(TKey, DateTime)

Updates the age of an object in the cache.

Declaration
void RefreshObject(TKey info, DateTime now)
Parameters
Type Name Description
TKey info

The object info.

DateTime now

The current time to set.

  • View Source
In this article
Back to top Generated by DocFX