LRUCache.getAndRefresh

Gets an item from the cache. A pointer to the item is returned, if found. If the item exists in the cache, its update time is updated.

Note that, if the item already existed and you change the value pointed to by the returned pointer, the create time will not be updated.

  1. T* getAndRefresh(hash_t key)
  2. T* getAndRefresh(hash_t key, time_t access_time)
    class LRUCache(T, bool TrackCreateTimes = false)
    T*
    getAndRefresh
    (
    hash_t key
    ,
    out time_t access_time
    )

Parameters

key hash_t

key to lookup

access_time time_t

access time of the element

Return Value

Type: T*

pointer to item value, may be null if key not found

Meta