Пример #1
0
        /// <summary>
        /// Returns a dictionary of the function end points that are type compatible
        /// with any branch of replicated parameters.
        /// </summary>
        /// <param name="context"></param>
        /// <param name="formalParams"></param>
        /// <param name="replicationInstructions"></param>
        /// <param name="classTable"></param>
        /// <param name="runtimeCore"></param>
        /// <returns></returns>
        public Dictionary <FunctionEndPoint, int> GetLooseConversionDistances(
            Runtime.Context context,
            List <StackValue> formalParams,
            List <ReplicationInstruction> replicationInstructions,
            ClassTable classTable,
            RuntimeCore runtimeCore)
        {
            Dictionary <FunctionEndPoint, int> ret = new Dictionary <FunctionEndPoint, int>();
            var reducedParams = Replicator.ComputeAllReducedParamsWithoutArraySampling(formalParams, replicationInstructions, runtimeCore);

            foreach (FunctionEndPoint fep in FunctionEndPoints)
            {
                foreach (var reducedParam in reducedParams)
                {
                    int distance = fep.GetConversionDistance(reducedParam, classTable, true, runtimeCore);
                    if (distance != (int)ProcedureDistance.InvalidDistance)
                    {
                        ret.Add(fep, distance);
                        break;
                    }
                }
            }

            return(ret);
        }