当前位置: 首页>>代码示例>>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;未经允许,请勿转载。