C# Класс Deveel.Data.Caching.Cache

A base implementation of a cache of objects.
Наследование: ICache
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Clear ( ) : void

Clear the cache of all the entries.

Dispose ( ) : void

Gets the closest prime number to the one specified.

A list of primes ordered from lowest to highest.

Remove ( object key ) : object

Removes a node for the given key from the cache.

This is useful for ensuring the cache does not contain out-dated information.

Set ( object key, object value ) : bool

Puts an object into the cache with the given key.

TryGet ( object key, object &value ) : bool

Защищенные методы

Метод Описание
Cache ( ) : System
CheckClean ( ) : void

This is called whenever at object is put into the cache.

This method should determine if the cache should be cleaned and call the clean method if appropriate.

Clean ( ) : int

Cleans away some old elements in the cache.

This method walks from the end, back wipe count elements putting each object on the recycle stack.

Dispose ( bool disposing ) : void
OnAllCleared ( ) : void

Notifies that the cache has been entirely cleared of all elements.

OnGetWalks ( long totalWalks, long totalGetOps ) : void

Notifies that some statistical information about the hash map has updated.

This should be used to compile statistical information about the number of walks a get operation takes to retreive an entry from the hash.

This method is called every 8192 gets.

OnObjectAdded ( object key, object value ) : void

Notifies that the given object and key has been added to the cache.

OnObjectRemoved ( object key, Object value ) : void

Notifies that the given object and key has been removed from the cache.

OnWipingNode ( object value ) : void

Notifies that the given object has been wiped from the cache by the clean up procedure.

RemoveObject ( object key ) : object
SetObject ( object key, object value ) : bool

When overridden in a derived class, it sets the value for the key given.

TryGetObject ( object key, object &value ) : bool
WipeMoreNodes ( ) : bool

Checks if the clean-up method should clean up more elements from the cache.

Описание методов

Cache() защищенный Метод

protected Cache ( ) : System
Результат System

CheckClean() защищенный Метод

This is called whenever at object is put into the cache.
This method should determine if the cache should be cleaned and call the clean method if appropriate.
protected CheckClean ( ) : void
Результат void

Clean() защищенный Метод

Cleans away some old elements in the cache.
This method walks from the end, back wipe count elements putting each object on the recycle stack.
protected Clean ( ) : int
Результат int

Clear() публичный Метод

Clear the cache of all the entries.
public Clear ( ) : void
Результат void

Dispose() публичный Метод

Gets the closest prime number to the one specified. A list of primes ordered from lowest to highest.
public Dispose ( ) : void
Результат void

Dispose() защищенный Метод

protected Dispose ( bool disposing ) : void
disposing bool
Результат void

OnAllCleared() защищенный Метод

Notifies that the cache has been entirely cleared of all elements.
protected OnAllCleared ( ) : void
Результат void

OnGetWalks() защищенный Метод

Notifies that some statistical information about the hash map has updated.
This should be used to compile statistical information about the number of walks a get operation takes to retreive an entry from the hash.

This method is called every 8192 gets.

protected OnGetWalks ( long totalWalks, long totalGetOps ) : void
totalWalks long
totalGetOps long
Результат void

OnObjectAdded() защищенный Метод

Notifies that the given object and key has been added to the cache.
protected OnObjectAdded ( object key, object value ) : void
key object
value object
Результат void

OnObjectRemoved() защищенный Метод

Notifies that the given object and key has been removed from the cache.
protected OnObjectRemoved ( object key, Object value ) : void
key object
value Object
Результат void

OnWipingNode() защищенный Метод

Notifies that the given object has been wiped from the cache by the clean up procedure.
protected OnWipingNode ( object value ) : void
value object The node value being wiped.
Результат void

Remove() публичный Метод

Removes a node for the given key from the cache.
This is useful for ensuring the cache does not contain out-dated information.
public Remove ( object key ) : object
key object
Результат object

RemoveObject() защищенный абстрактный Метод

protected abstract RemoveObject ( object key ) : object
key object
Результат object

Set() публичный Метод

Puts an object into the cache with the given key.
public Set ( object key, object value ) : bool
key object The key used to store the object.
value object The object to add to the cache.
Результат bool

SetObject() защищенный абстрактный Метод

When overridden in a derived class, it sets the value for the key given.
protected abstract SetObject ( object key, object value ) : bool
key object The key corresponding to the value to set.
value object the value to set into the cache.
Результат bool

TryGet() публичный Метод

public TryGet ( object key, object &value ) : bool
key object
value object
Результат bool

TryGetObject() защищенный абстрактный Метод

protected abstract TryGetObject ( object key, object &value ) : bool
key object
value object
Результат bool

WipeMoreNodes() защищенный Метод

Checks if the clean-up method should clean up more elements from the cache.
protected WipeMoreNodes ( ) : bool
Результат bool