Interface IMemoizer
Interface for function memoizers.
Namespace: System.Memory
Assembly: Nuqleon.Memory.dll
Syntax
public interface IMemoizer
Methods
Memoize<T, TResult>(Func<T, TResult>, MemoizationOptions, IEqualityComparer<T>)
Memoizes the specified function
.
Declaration
IMemoizedDelegate<Func<T, TResult>> Memoize<T, TResult>(Func<T, TResult> function, MemoizationOptions options, IEqualityComparer<T> comparer = null)
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 function argument during lookup in the memoization cache. |
Returns
Type | Description |
---|---|
IMemoizedDelegate<System.Func<T, TResult>> | A memoized delegate containing the memoized function and providing access to the memoization cache. |
Type Parameters
Name | Description |
---|---|
T | Type of the function argument. |
TResult | Type of the function result. |