HomeForumSourceResearchGuide
Sign in to contribute to source. how it works
Type definition file data.Cache by barry
expand copy to clipboardexpand
/* {"description" : "Cache data in a fixed-sized amount of memory, for rapid retrieval."} */

interface Cache {
	/* {"@description" : "Instantiate a new cache, with a given maximum size in bytes."} */
	Cache(int maxSize)
	/* {"@description" : "Set the maximum size of the cache, specified in bytes. Items may be evicted if the new maximum size is smaller than the existing value."} */
	void setSize(int maxSize)
	/* {"@description" : "Get an item from the cache, if it exists."} */
	byte[] get(char key[])
	/* {"@description" : "Put an item into the cache. If an item of the same key already exists, it is overwitten with this version. Items may be evicted from the cache to make space for the new item."} */
	void put(char key[], byte value[])
	/* {"@description" : "Remove an item from the cache, if it exists."} */
	void delete(char key[])
}
Revision history
To propose a new revision to this entity, use dana source put -ut your/new/version.dn -n data.Cache -m "reason for update" -u yourUsername
Version 1 (this version) by barry
Notes for this version: Adds a cache API.