本文整理汇总了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;
}
示例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);