當前位置: 首頁>>代碼示例>>C#>>正文


C# FunctionGroup.GetCastDistances方法代碼示例

本文整理匯總了C#中ProtoCore.FunctionGroup.GetCastDistances方法的典型用法代碼示例。如果您正苦於以下問題:C# FunctionGroup.GetCastDistances方法的具體用法?C# FunctionGroup.GetCastDistances怎麽用?C# FunctionGroup.GetCastDistances使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ProtoCore.FunctionGroup的用法示例。


在下文中一共展示了FunctionGroup.GetCastDistances方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: GetCompliantFEP

        private FunctionEndPoint GetCompliantFEP(
            Context context, 
            List<StackValue> arguments, 
            FunctionGroup funcGroup, 
            List<ReplicationInstruction> replicationInstructions,
            StackFrame stackFrame, 
            RuntimeCore runtimeCore,
            bool allowArrayPromotion = false)
        {
            Dictionary<FunctionEndPoint, int> candidatesWithDistances = 
                funcGroup.GetConversionDistances(
                    context, 
                    arguments, 
                    replicationInstructions, 
                    runtimeCore.DSExecutable.classTable, 
                    runtimeCore,
                    allowArrayPromotion);

            Dictionary<FunctionEndPoint, int> candidatesWithCastDistances =
                funcGroup.GetCastDistances(
                    context, 
                    arguments, 
                    replicationInstructions, 
                    runtimeCore.DSExecutable.classTable, 
                    runtimeCore);

            List<FunctionEndPoint> candidateFunctions = GetCandidateFunctions(stackFrame, candidatesWithDistances);

            FunctionEndPoint compliantTarget = 
                GetCompliantTarget(
                    context, 
                    arguments, 
                    replicationInstructions, 
                    stackFrame,
                    runtimeCore, 
                    candidatesWithCastDistances, 
                    candidateFunctions, 
                    candidatesWithDistances);

            return compliantTarget;
        }
開發者ID:AutodeskFractal,項目名稱:Dynamo,代碼行數:41,代碼來源:CallSite.cs

示例2: ComputeFeps


//.........這裏部分代碼省略.........
                        continue;

                    log.AppendLine("Resolution succeeded against FEP Cluster");
                    foreach (FunctionEndPoint fep in lookups.Keys)
                        log.AppendLine("\t - " + fep);

                    List<FunctionEndPoint> feps = new List<FunctionEndPoint>();
                    feps.AddRange(lookups.Keys);

                    //log.AppendLine("Resolution completed in " + sw.ElapsedMilliseconds + "ms");
                    if (core.Options.DumpFunctionResolverLogic)
                        core.DSExecutable.EventSink.PrintMessage(log.ToString());

                    //Otherwise we have a cluster of FEPs that can be used to dispatch the array
                    resolvesFeps = feps;
                    replicationInstructions = rc.Instructions;

                    return;
                }
            }

            #endregion

            #region Case 3: Match with type conversion, but no array promotion

            {
                log.AppendLine("Case 3: Type conversion");


                Dictionary<FunctionEndPoint, int> candidatesWithDistances =
                    funcGroup.GetConversionDistances(context, arguments, replicationControl.Instructions,
                                                     core.ClassTable, core);
                Dictionary<FunctionEndPoint, int> candidatesWithCastDistances =
                    funcGroup.GetCastDistances(context, arguments, replicationControl.Instructions, core.ClassTable,
                                               core);

                List<FunctionEndPoint> candidateFunctions = GetCandidateFunctions(stackFrame, candidatesWithDistances);
                FunctionEndPoint compliantTarget = GetCompliantTarget(context, arguments,
                                                                      replicationControl.Instructions, stackFrame, core,
                                                                      candidatesWithCastDistances, candidateFunctions,
                                                                      candidatesWithDistances);

                if (compliantTarget != null)
                {
                    log.AppendLine("Resolution Succeeded: " + compliantTarget);

                    if (core.Options.DumpFunctionResolverLogic)
                        core.DSExecutable.EventSink.PrintMessage(log.ToString());

                    resolvesFeps = new List<FunctionEndPoint>() { compliantTarget };
                    replicationInstructions = replicationControl.Instructions;
                    return;
                }
            }

            #endregion

            #region Case 4: Match with type conversion and replication

            log.AppendLine("Case 4: Replication + Type conversion");
            {
                if (arguments.Any(arg => arg.IsArray))
                {
                    //Build the possible ways in which we might replicate
                    List<List<ReplicationInstruction>> replicationTrials =
                        Replicator.BuildReplicationCombinations(replicationControl.Instructions, arguments, core);
開發者ID:heegwon,項目名稱:Dynamo,代碼行數:67,代碼來源:CallSite.cs


注:本文中的ProtoCore.FunctionGroup.GetCastDistances方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。