Python Cache
objType |
the class of the object to cache |
size: int |
the maximum size allowable for the cache Default value: 0 |
Constructor.
Destructor
newKey: int |
|
newOne |
Add a record to the cache. It must be valid().
Return int value:
key |
Remove a record from the cache
Return bool value:
pos: int |
Remove a record from the cache
Return bool value:
searchKey |
|
fetchIfMissing: bool |
Default value: True |
Locate the cache position (-1 if not found)
Note: Pull into cache if fetchIfNotFound is True
Note: key must be a positive (non-zero) number
Return int value:
searchKey: int |
Check if key exists in list
Return bool value:
key |
Get pointer to data for the key. Check if result is valid().
Note: key must be a positive (non-zero) number
pos: int |
position in cache, from 0+ |
This method allows the class instance to be indexed, e.g. HelloCache[2] to get the second element (not key==2)
Return value: the instance at position
Return the size of the cache when using the len() function