当前位置: 首页>>代码示例>>C#>>正文


C# FunctionGroup.GetExactMatchStatistics方法代码示例

本文整理汇总了C#中ProtoCore.FunctionGroup.GetExactMatchStatistics方法的典型用法代码示例。如果您正苦于以下问题:C# FunctionGroup.GetExactMatchStatistics方法的具体用法?C# FunctionGroup.GetExactMatchStatistics怎么用?C# FunctionGroup.GetExactMatchStatistics使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ProtoCore.FunctionGroup的用法示例。


在下文中一共展示了FunctionGroup.GetExactMatchStatistics方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: ComputeFeps

        private void ComputeFeps(
            StringBuilder log, 
            Context context, 
            List<StackValue> arguments,
            FunctionGroup funcGroup,
            List<ReplicationInstruction> instructions, 
            List<List<ReplicationGuide>> partialReplicationGuides,
            StackFrame stackFrame,
            RuntimeCore runtimeCore,
            out List<FunctionEndPoint> resolvesFeps,
            out List<ReplicationInstruction> replicationInstructions)
        {
            //With replication guides only

            //Exact match
            //Match with single elements
            //Match with single elements with upcast

            //Try replication without type cast

            //Match with type conversion
            //Match with type conversion with upcast

            //Try replication + type casting

            //Try replication + type casting + Array promotion

            #region First Case: Replicate only according to the replication guides
            {
                log.AppendLine("Case 1: Exact Match");

                FunctionEndPoint fep = Case1GetCompleteMatchFEP(context, arguments, funcGroup, instructions,
                                                                stackFrame,
                                                                runtimeCore, log);
                if (fep != null)
                {
                    if (runtimeCore.Options.DumpFunctionResolverLogic)
                        runtimeCore.DSExecutable.EventSink.PrintMessage(log.ToString());

                    resolvesFeps = new List<FunctionEndPoint>() { fep };
                    replicationInstructions = instructions;

                    return;
                }
            }

            #endregion

            #region Case 1a: Replicate only according to the replication guides, but with a sub-typing match
            {
                log.AppendLine("Case 1a: Replication guides + auto-replication + no cases");
                List<List<StackValue>> reducedParams = Replicator.ComputeAllReducedParams(arguments, instructions, runtimeCore);
                int resolutionFailures;

                Dictionary<FunctionEndPoint, int> lookups = funcGroup.GetExactMatchStatistics(
                    context, reducedParams, stackFrame, runtimeCore,
                    out resolutionFailures);

                if (resolutionFailures == 0)
                {
                    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);

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

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

                    return;
                }
            }

            #endregion


            var replicationTrials = Replicator.BuildReplicationCombinations(instructions, arguments, runtimeCore);
            #region Case 2: Replication with no type cast

            {
                log.AppendLine("Case 2: Beginning Auto-replication, no casts");

                //Build the possible ways in which we might replicate
                foreach (List<ReplicationInstruction> repOption in replicationTrials)
                {
                    List<List<StackValue>> reducedParams = Replicator.ComputeAllReducedParams(arguments, repOption, runtimeCore);
                    int resolutionFailures;

                    Dictionary<FunctionEndPoint, int> lookups = funcGroup.GetExactMatchStatistics(
                        context, reducedParams, stackFrame, runtimeCore,
                        out resolutionFailures);

                    if (resolutionFailures > 0)
                        continue;

//.........这里部分代码省略.........
开发者ID:AutodeskFractal,项目名称:Dynamo,代码行数:101,代码来源:CallSite.cs


注:本文中的ProtoCore.FunctionGroup.GetExactMatchStatistics方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。