public ComputeMethodInput(IFunction function, ComputeMethodDef method, AbstractInvocation invocation)
            : base(function)
        {
            Method               = method;
            Invocation           = invocation;
            NextInterceptorIndex = invocation.GetCurrentInterceptorIndex();

            var arguments        = invocation.Arguments;
            var argumentHandlers = method.ArgumentHandlers;
            var preprocessingArgumentHandlers = method.PreprocessingArgumentHandlers;

            if (preprocessingArgumentHandlers != null)
            {
                foreach (var(handler, index) in preprocessingArgumentHandlers)
                {
                    handler.PreprocessFunc !.Invoke(method, invocation, index);
                }
            }

            var hashCode = System.HashCode.Combine(
                HashCode,
                method.InvocationTargetHandler.GetHashCodeFunc(invocation.InvocationTarget));

            for (var i = 0; i < arguments.Length; i++)
            {
                hashCode ^= argumentHandlers[i].GetHashCodeFunc(arguments[i]);
            }
            HashCode = hashCode;
        }
 public ComputeMethodFunctionBase(
     ComputeMethodDef method,
     Generator <LTag> versionGenerator,
     IServiceProvider services,
     ILogger <ComputeMethodFunction <T> >?log = null)
     : base(method, services)
 {
     Log = log ?? NullLogger <ComputeMethodFunction <T> > .Instance;
     VersionGenerator = versionGenerator;
 }
Exemple #3
0
 public AsyncComputeMethodFunction(
     ComputeMethodDef method,
     Generator <LTag> versionGenerator,
     IServiceProvider services,
     ILogger <ComputeMethodFunction <T> >?log = null)
     : base(method, versionGenerator, services, log)
 {
     if (!method.Options.IsAsyncComputed)
     {
         throw Stl.Internal.Errors.InternalError(
                   $"This type shouldn't be used with {nameof(ComputedOptions)}.{nameof(ComputedOptions.IsAsyncComputed)} == false option.");
     }
 }
 protected abstract ComputeFunctionBase <T> CreateFunction <T>(ComputeMethodDef method);
Exemple #5
0
 protected ComputeFunctionBase(ComputeMethodDef method, IServiceProvider services)
     : base(services)
 {
     Method  = method;
     Options = method.Options;
 }