abstract class Tinman.Core.Caching.ObjectDataCache<TObject ref>

Derived from

DataCache abstract

Base class for data caches that hold an object per cache slot.

IDisposable objects in cache slots are IDisposable.Dispose d when the cache slot is cleared.

Public / Methods


public method Get → (1)

pageIndex in : int32

The page index.

returns → TObject

The object or null.

Returns the object of the given page.


public method Set → (2)

pageIndex in : int32

The page index.

obj in : TObject own

The object or null.

Sets the object of the given page.

Protected / Constructors


protected constructor ObjectDataCache → (2)

pageCount in : int32

The cache page count.

maxWeightSum opt : int64 = 0

The maximum weight sum. If 0 the maximum limit is disabled.

Creates a new instance of ObjectDataCache.

Protected / Methods


protected virtual method Recycle → (1)

obj in : TObject

The cache slot object (never null). that has been replaced with some new value. The new object will never be the same as obj in.

This method is called each time a non-null cache slot object is replaced with another value.