Header menu logo fantomas

MruCache<'Token, 'Key, 'Value> Type

 Simple priority caching for a small number of key/value associations.
 This cache may age-out results that have been Set by the caller.
 Because of this, the caller must be able to tolerate values
 that aren't what was originally passed to the Set function.

 Concurrency: This collection is thread-safe, though concurrent use may result in different
 threads seeing different live sets of cached items.

  - areSimilar: Keep at most once association for two similar keys (as given by areSimilar)

Constructors

Constructor Description

MruCache(keepStrongly, areSame, ?isStillValid, ?areSimilar, ?requiredToKeep, ?keepMax)

Full Usage: MruCache(keepStrongly, areSame, ?isStillValid, ?areSimilar, ?requiredToKeep, ?keepMax)

Parameters:
    keepStrongly : int
    areSame : 'Key * 'Key -> bool
    ?isStillValid : 'Key * 'Value -> bool
    ?areSimilar : 'Key * 'Key -> bool
    ?requiredToKeep : 'Value -> bool
    ?keepMax : int

Returns: MruCache<'Token, 'Key, 'Value>
keepStrongly : int
areSame : 'Key * 'Key -> bool
?isStillValid : 'Key * 'Value -> bool
?areSimilar : 'Key * 'Key -> bool
?requiredToKeep : 'Value -> bool
?keepMax : int
Returns: MruCache<'Token, 'Key, 'Value>

Instance members

Instance member Description

this.Clear

Full Usage: this.Clear

Parameters:
    arg0 : 'Token

Clear out the cache.

arg0 : 'Token

this.ContainsSimilarKey

Full Usage: this.ContainsSimilarKey

Parameters:
    arg0 : 'Token
    key : 'Key

Returns: bool

Get the similar (subsumable) value for the given key or None if not already available.

arg0 : 'Token
key : 'Key
Returns: bool

this.RemoveAnySimilar

Full Usage: this.RemoveAnySimilar

Parameters:
    arg0 : 'Token
    key : 'Key

Remove the given value from the mru cache.

arg0 : 'Token
key : 'Key

this.Resize

Full Usage: this.Resize

Parameters:
    arg0 : 'Token
    newKeepStrongly : int
    ?newKeepMax : int

Resize

arg0 : 'Token
newKeepStrongly : int
?newKeepMax : int

this.Set

Full Usage: this.Set

Parameters:
    arg0 : 'Token
    key : 'Key
    value : 'Value

Set the given key.

arg0 : 'Token
key : 'Key
value : 'Value

this.TryGet

Full Usage: this.TryGet

Parameters:
    arg0 : 'Token
    key : 'Key

Returns: 'Value option

Get the value for the given key or None, but only if entry is still valid

arg0 : 'Token
key : 'Key
Returns: 'Value option

this.TryGetAny

Full Usage: this.TryGetAny

Parameters:
    arg0 : 'Token
    key : 'Key

Returns: 'Value option

Get the value for the given key or None if not still valid.

arg0 : 'Token
key : 'Key
Returns: 'Value option

this.TryGetSimilar

Full Usage: this.TryGetSimilar

Parameters:
    arg0 : 'Token
    key : 'Key

Returns: 'Value option

Get the value for the given key or None, but only if entry is still valid. Skips `areSame` checking unless `areSimilar` is not provided.

arg0 : 'Token
key : 'Key
Returns: 'Value option

this.TryGetSimilarAny

Full Usage: this.TryGetSimilarAny

Parameters:
    arg0 : 'Token
    key : 'Key

Returns: 'Value option

Get the value for the given key or None if not still valid. Skips `areSame` checking unless `areSimilar` is not provided.

arg0 : 'Token
key : 'Key
Returns: 'Value option

Type something to start searching.