Cache.add

Adds an item to the cache. If the cache is full, the oldest item will be removed and replaced with the new item.

class Cache(size_t ValueSize = 0, bool TrackCreateTimes = false)
protected
add
(
hash_t key
,
out time_t access_time
)
out (cache_item) { assert (cache_item !is null); }

Parameters

key hash_t

key of item

access_time time_t

access time (also the create time)

Return Value

Type: CacheItem*

the added cache item.

Out: The returned pointer is never null.

Meta