Show / Hide Table of Contents

Interface IMemoizationCacheFactory

Interface for memoization cache factories.

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

Methods

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

Creates a memoization cache for the specified function using the specified comparer to compare cache entries.

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

The function to memoize.

MemoizationOptions options

Flags to influence the memoization behavior.

System.Collections.Generic.IEqualityComparer<T> comparer

Comparer to compare the key during lookup in the memoization cache.

Returns
Type Description
IMemoizationCache<T, TResult>

An empty memoization cache instance.

Type Parameters
Name Description
T

Type of the memoization cache entry keys.

TResult

Type of the memoization cache entry values.

Extension Methods

InternCache.CreateInternCache<T>(IMemoizationCacheFactory)
InternCache.CreateWeakInternCache<T>(IMemoizationCacheFactory, Func<T, T>)
MemoizationCacheFactoryExtensions.WithThreadLocal(IMemoizationCacheFactory)
MemoizationCacheFactoryExtensions.WithThreadLocal(IMemoizationCacheFactory, Boolean)
MemoizationCacheFactoryExtensions.Synchronized(IMemoizationCacheFactory)
In This Article
Back to top Generated by DocFX