Class Memoizer
Exposes factory methods to create function memoizers.
Inheritance
System.Object
Memoizer
Namespace: System.Memory
Assembly: Nuqleon.Memory.dll
Syntax
public static class Memoizer : Object
Methods
Create(IMemoizationCacheFactory)
Creates a function memoizer that uses the specified factory
to create memoization caches.
Declaration
public static IMemoizer Create(IMemoizationCacheFactory factory)
Parameters
Type | Name | Description |
---|---|---|
IMemoizationCacheFactory | factory | Memoization cache factory to use when memoizing functions using the resulting memoizer. |
Returns
Type | Description |
---|---|
IMemoizer | Function memoizer to speed up function invocations by caching their result. |
CreateWeak(IWeakMemoizationCacheFactory)
Creates a function memoizer that uses the specified factory
to create memoization caches that don't keep the function arguments alive.
Declaration
public static IWeakMemoizer CreateWeak(IWeakMemoizationCacheFactory factory)
Parameters
Type | Name | Description |
---|---|---|
IWeakMemoizationCacheFactory | factory | Memoization cache factory to use when memoizing functions using the resulting memoizer. |
Returns
Type | Description |
---|---|
IWeakMemoizer | Function memoizer to speed up function invocations by caching their result as long as the memoized function arguments are alive. |