DeveelDB
20151217
complete SQL database system, primarly developed for .NET/Mono frameworks
|
Represents a cache of Objects. /summary> More...
Public Member Functions | |
bool | Set (object key, object value) |
Puts an object into the cache with the given key. More... | |
bool | TryGet (object key, out object value) |
Tries to get an object for the given key from the underlying cache system. More... | |
object | Remove (Object key) |
Removes a node for the given key from the cache. More... | |
virtual void | Clear () |
Clear the cache of all the entries. More... | |
void | Dispose () |
Public Member Functions inherited from Deveel.Data.Caching.ICache | |
object | Remove (object key) |
Removes an object from the cache. More... | |
Static Public Member Functions | |
static int | ClosestPrime (int value) |
Protected Member Functions | |
Cache () | |
virtual void | CheckClean () |
This is called whenever at object is put into the cache. More... | |
virtual bool | WipeMoreNodes () |
Checks if the clean-up method should clean up more elements from the cache. More... | |
virtual void | OnWipingNode (object value) |
Notifies that the given object has been wiped from the cache by the clean up procedure. More... | |
virtual void | OnObjectAdded (object key, object value) |
Notifies that the given object and key has been added to the cache. More... | |
virtual void | OnObjectRemoved (object key, Object value) |
Notifies that the given object and key has been removed from the cache. More... | |
virtual void | OnAllCleared () |
Notifies that the cache has been entirely cleared of all elements. More... | |
virtual void | OnGetWalks (long totalWalks, long totalGetOps) |
Notifies that some statistical information about the hash map has updated. More... | |
abstract bool | SetObject (object key, object value) |
When overridden in a derived class, it sets the value for the key given. More... | |
abstract bool | TryGetObject (object key, out object value) |
abstract object | RemoveObject (object key) |
virtual int | Clean () |
Cleans away some old elements in the cache. More... | |
virtual void | Dispose (bool disposing) |
Properties | |
virtual int | NodeCount [get] |
Gets the number of nodes that are currently being stored in the cache. More... | |
Private Member Functions | |
~Cache () | |
Private Attributes | |
int | currentCacheSize |
The current cache size. More... | |
readonly int | wipeTo |
The number of nodes that should be left available when the cache becomes too full and a clean up operation occurs. More... | |
Static Private Attributes | |
static readonly int[] | PrimeList |
A list of primes ordered from lowest to highest. More... | |
|
inlineprotected |
|
inlineprotectedvirtual |
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.
Reimplemented in Deveel.Data.Caching.TableCellCache.Cache, Deveel.Data.Caching.TableCellCache.Cache, and Deveel.Data.Caching.SizeLimitedCache.
|
inlineprotectedvirtual |
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.
summary> Gets the closest prime number to the one specified. /summary> param name="value">The integer value to which the returned integer has to be close.
returns>
|
inlinevirtual |
Clear the cache of all the entries.
Implements Deveel.Data.Caching.ICache.
Reimplemented in Deveel.Data.Caching.MemoryCache, and Deveel.Data.Caching.CacheAdapter.
Definition at line 190 of file Cache.cs.
|
inlinestatic |
Definition at line 214 of file Cache.cs.
|
inlineprotectedvirtual |
Reimplemented in Deveel.Data.Caching.MemoryCache.
Definition at line 275 of file Cache.cs.
|
inlineprotectedvirtual |
Notifies that the cache has been entirely cleared of all elements.
Definition at line 97 of file Cache.cs.
|
inlineprotectedvirtual |
Notifies that some statistical information about the hash map has updated.
totalWalks | |
totalGetOps |
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.
Reimplemented in Deveel.Data.Caching.TableCellCache.Cache, and Deveel.Data.Caching.TableCellCache.Cache.
|
inlineprotectedvirtual |
Notifies that the given object and key has been added to the cache.
key | |
value |
Definition at line 81 of file Cache.cs.
|
inlineprotectedvirtual |
Notifies that the given object and key has been removed from the cache.
key | |
value |
Definition at line 90 of file Cache.cs.
|
inlineprotectedvirtual |
Notifies that the given object has been wiped from the cache by the clean up procedure.
value | The node value being wiped. |
Reimplemented in Deveel.Data.Caching.TableCellCache.Cache, and Deveel.Data.Caching.TableCellCache.Cache.
|
inline |
Removes a node for the given key from the cache.
key |
This is useful for ensuring the cache does not contain out-dated information.
Definition at line 178 of file Cache.cs.
|
protectedpure virtual |
Implemented in Deveel.Data.Caching.MemoryCache, and Deveel.Data.Caching.CacheAdapter.
|
inline |
Puts an object into the cache with the given key.
key | The key used to store the object. |
value | The object to add to the cache. |
Implements Deveel.Data.Caching.ICache.
Definition at line 150 of file Cache.cs.
|
protectedpure virtual |
When overridden in a derived class, it sets the value for the key given.
key | The key corresponding to the value to set. |
value | the value to set into the cache. |
false
if the key existed and the value was set or otherwise true
if the key was not found and the value was added to the cache. Implemented in Deveel.Data.Caching.MemoryCache, and Deveel.Data.Caching.CacheAdapter.
|
inline |
Tries to get an object for the given key from the underlying cache system.
key | The key of the object to return. |
value | The value corresponding to the provided key, obtained from the underlying cache. This value can also be null if it was not possible to find the key given in the cache. |
true
if the corresponding key was found in the underlying cache, otherwise false
. Implements Deveel.Data.Caching.ICache.
Definition at line 162 of file Cache.cs.
|
protectedpure virtual |
Implemented in Deveel.Data.Caching.MemoryCache, and Deveel.Data.Caching.CacheAdapter.
|
inlineprotectedvirtual |
Checks if the clean-up method should clean up more elements from the cache.
Reimplemented in Deveel.Data.Caching.TableCellCache.Cache, and Deveel.Data.Caching.TableCellCache.Cache.
Definition at line 64 of file Cache.cs.
|
private |
|
staticprivate |
|
private |
|
get |