LRUCache.getRefreshOrCreate

Gets an item from the cache or creates it if not already existing. If the item exists in the cache, its update time is updated, otherwise its create time is set.

Note that the create time is set only if an item is created, not if it already existed and you change the value referenced by the returned pointer.

  1. T* getRefreshOrCreate(hash_t key)
    class LRUCache(T, bool TrackCreateTimes = false)
    T*
    getRefreshOrCreate
    (
    hash_t key
    )
    out (val) { assert (val !is null); }
  2. T* getRefreshOrCreate(hash_t key, bool existed)
  3. T* getRefreshOrCreate(hash_t key, time_t access_time, bool existed)

Parameters

key hash_t

key to lookup or create

Return Value

Type: T*

The returned reference is never null.

Meta