Module implementing classes used for caching objects.
None |
E5Cache | Class implementing a LRU cache of a specific size. |
None |
Class implementing a LRU cache of a specific size.
If the maximum number of entries is exceeded, the least recently used item is removed from the cache. A cache hit moves the entry to the front of the cache.
None |
None |
E5Cache | Constructor |
__adjustToSize | Private method to adjust the cache to its size. |
__moveLast | Private method to move a cached item to the MRU position. |
__pruneCache | Private slot to prune outdated cache entries and restart the timer. |
add | Public method to add an item to the cache. |
clear | Public method to clear the cache. |
get | Public method to get an entry from the cache given its key. |
getMaximumCacheTime | Public method to get the maximum time entries may exist in the cache. |
getSize | Public method to get the maximum size of the cache. |
info | Public method to get some information about the cache. |
length | Public method to get the current length of the cache. |
remove | Public method to remove an item from the cache. |
reset | Public method to reset the cache. |
setMaximumCacheTime | Public method to set the maximum time entries may exist in the cache. |
setSize | Public method to change the maximum size of the cache. |
None |
Constructor
Private method to adjust the cache to its size.
Private method to move a cached item to the MRU position.
Private slot to prune outdated cache entries and restart the timer.
Public method to add an item to the cache.
If the key is already in use, the cached item is replaced by the new one given and is moved to the MRU position
Public method to clear the cache.
Public method to get an entry from the cache given its key.
If the key is present in the cache, it is moved to the MRU position.
Public method to get the maximum time entries may exist in the cache.
Public method to get the maximum size of the cache.
Public method to get some information about the cache.
Public method to get the current length of the cache.
Public method to remove an item from the cache.
Public method to reset the cache.
This is like clear() but sets the various counters to their initial value as well.
Public method to set the maximum time entries may exist in the cache.
Public method to change the maximum size of the cache.