Show / Hide Table of Contents

Interface IWeakMemoizationCacheFactory

Interface for weak memoization cache factories.

Namespace: System.Memory
Assembly: Nuqleon.Memory.dll
Syntax
public interface IWeakMemoizationCacheFactory

Methods

Create<T, TResult>(Func<T, TResult>, MemoizationOptions)

Creates a memoization cache for the specified function that doesn't keep cache entry keys alive.

Declaration
IMemoizationCache<T, TResult> Create<T, TResult>(Func<T, TResult> function, MemoizationOptions options)
    where T : class
Parameters
Type Name Description
System.Func<T, TResult> function

The function to memoize.

MemoizationOptions options

Flags to influence the memoization behavior.

Returns
Type Description
IMemoizationCache<T, TResult>

An empty memoization cache instance.

Type Parameters
Name Description
T

Type of the memoization cache entry keys. This type has to be a reference type.

TResult

Type of the memoization cache entry values.

Extension Methods

WeakMemoizationCacheFactoryExtensions.WithThreadLocal(IWeakMemoizationCacheFactory)
WeakMemoizationCacheFactoryExtensions.WithThreadLocal(IWeakMemoizationCacheFactory, Boolean)
In This Article
Back to top Generated by DocFX