本文整理汇总了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;
//.........这里部分代码省略.........