C# Class Deveel.Data.Caching.Cache

A base implementation of a cache of objects.
Inheritance: ICache
Afficher le fichier Open project: deveel/deveeldb Class Usage Examples

Méthodes publiques

Méthode Description
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

Méthodes protégées

Méthode Description
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.

Method Details

Cache() protected méthode

protected Cache ( ) : System
Résultat System

CheckClean() protected méthode

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
Résultat void

Clean() protected méthode

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
Résultat int

Clear() public méthode

Clear the cache of all the entries.
public Clear ( ) : void
Résultat void

Dispose() public méthode

Gets the closest prime number to the one specified. A list of primes ordered from lowest to highest.
public Dispose ( ) : void
Résultat void

Dispose() protected méthode

protected Dispose ( bool disposing ) : void
disposing bool
Résultat void

OnAllCleared() protected méthode

Notifies that the cache has been entirely cleared of all elements.
protected OnAllCleared ( ) : void
Résultat void

OnGetWalks() protected méthode

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
Résultat void

OnObjectAdded() protected méthode

Notifies that the given object and key has been added to the cache.
protected OnObjectAdded ( object key, object value ) : void
key object
value object
Résultat void

OnObjectRemoved() protected méthode

Notifies that the given object and key has been removed from the cache.
protected OnObjectRemoved ( object key, Object value ) : void
key object
value Object
Résultat void

OnWipingNode() protected méthode

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.
Résultat void

Remove() public méthode

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
Résultat object

RemoveObject() protected abstract méthode

protected abstract RemoveObject ( object key ) : object
key object
Résultat object

Set() public méthode

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.
Résultat bool

SetObject() protected abstract méthode

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.
Résultat bool

TryGet() public méthode

public TryGet ( object key, object &value ) : bool
key object
value object
Résultat bool

TryGetObject() protected abstract méthode

protected abstract TryGetObject ( object key, object &value ) : bool
key object
value object
Résultat bool

WipeMoreNodes() protected méthode

Checks if the clean-up method should clean up more elements from the cache.
protected WipeMoreNodes ( ) : bool
Résultat bool