EvaluatorGroupCallAndMemoizeTResult, TParameter1, TParameter2, TParameter3, TParameter4, TParameter5 Method (EvaluatorGroupCallback5TResult, TParameter1, TParameter2, TParameter3, TParameter4, TParameter5, TParameter1, TParameter2, TParameter3, TParameter4, TParameter5) |
Optimizes calls to a callback that is expected to be called multiple times so that future calls
with the same parameters return a cached result rather than actually invoking the callback again.
The first time this method is called with a particular set of parameters, the callback
is invoked and the result is stored in the evaluator group. The second and successive times this
method is called with the same parameters, the cached result is returned without invoking the
callback.
Namespace:
AGI.Foundation
Assembly:
AGI.Foundation.Core (in AGI.Foundation.Core.dll) Version: 24.3.420.0 (24.3.420.0)
Syntax public TResult CallAndMemoize<TResult, TParameter1, TParameter2, TParameter3, TParameter4, TParameter5>(
EvaluatorGroupCallback5<TResult, TParameter1, TParameter2, TParameter3, TParameter4, TParameter5> callback,
TParameter1 parameter1,
TParameter2 parameter2,
TParameter3 parameter3,
TParameter4 parameter4,
TParameter5 parameter5
)
Public Function CallAndMemoize(Of TResult, TParameter1, TParameter2, TParameter3, TParameter4, TParameter5) (
callback As EvaluatorGroupCallback5(Of TResult, TParameter1, TParameter2, TParameter3, TParameter4, TParameter5),
parameter1 As TParameter1,
parameter2 As TParameter2,
parameter3 As TParameter3,
parameter4 As TParameter4,
parameter5 As TParameter5
) As TResult
public:
generic<typename TResult, typename TParameter1, typename TParameter2, typename TParameter3, typename TParameter4, typename TParameter5>
TResult CallAndMemoize(
EvaluatorGroupCallback5<TResult, TParameter1, TParameter2, TParameter3, TParameter4, TParameter5>^ callback,
TParameter1 parameter1,
TParameter2 parameter2,
TParameter3 parameter3,
TParameter4 parameter4,
TParameter5 parameter5
)
member CallAndMemoize :
callback : EvaluatorGroupCallback5<'TResult, 'TParameter1, 'TParameter2, 'TParameter3, 'TParameter4, 'TParameter5> *
parameter1 : 'TParameter1 *
parameter2 : 'TParameter2 *
parameter3 : 'TParameter3 *
parameter4 : 'TParameter4 *
parameter5 : 'TParameter5 -> 'TResult
Parameters
- callback
- Type: AGI.FoundationEvaluatorGroupCallback5TResult, TParameter1, TParameter2, TParameter3, TParameter4, TParameter5
The method to invoke. This method must not have side-effects. - parameter1
- Type: TParameter1
The first parameter to the callback. - parameter2
- Type: TParameter2
The second parameter to the callback. - parameter3
- Type: TParameter3
The third parameter to the callback. - parameter4
- Type: TParameter4
The fourth parameter to the callback. - parameter5
- Type: TParameter5
The fifth parameter to the callback.
Type Parameters
- TResult
- The type of result returned by the method.
- TParameter1
- The type of the first parameter to the callback.
- TParameter2
- The type of the second parameter to the callback.
- TParameter3
- The type of the third parameter to the callback.
- TParameter4
- The type of the fourth parameter to the callback.
- TParameter5
- The type of the fifth parameter to the callback.
Return Value
Type:
TResultThe result of invoking the callback with the specified parameters.
Exceptions See Also