ICache.register

Registers a new cache element and obtains the cache item index for it. If the cache is full, the oldest cache element is replaced. If realtime is enabled, time is expected to be at least the time value of the most recent cache element. If realtime is disabled and time is less than the time value of the most recent cache element, nothing is done and a value of at least length is returned.

class ICache
protected
size_t
register
(
hash_t key
,
out time_t access_time
)
out (index) { assert (index < this.max_length); }

Parameters

key hash_t

cache element key

access_time time_t

cache element creation time

Return Value

Type: size_t

the index of the cache item that corresponds to the newly registered cache element or a value of at least length if realtime is disabled and time is less than the time value of the most recent cache element.

In: If realtime is enabled, time must bebe at least the time value of the most recent cache element.

Out: If realtime is enabled, the returned index is below length.

Meta