ObjectDataCache

Description

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

Get


public method Get → (1)

pageIndex in : int32

The page index.

returns → TObject

The object or null.

Returns the object of the given page.

Set


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

Object​Data​Cache


protected constructor ObjectDataCache → (2)

pageCount in : int32

[>0]
The cache page count.

maxWeightSum opt : int64 = 0

[>=0]
The maximum weight sum. If 0 the maximum limit is disabled.

Creates a new instance of ObjectDataCache.

Protected / Methods

Recycle


[EmptyBody]
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.