本文整理汇总了C#中G25.MustCastIfAssigned方法的典型用法代码示例。如果您正苦于以下问题:C# G25.MustCastIfAssigned方法的具体用法?C# G25.MustCastIfAssigned怎么用?C# G25.MustCastIfAssigned使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类G25
的用法示例。
在下文中一共展示了G25.MustCastIfAssigned方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: WriteSetCopyCrossFloat
/// <summary>
/// Writes a function to copy the value of one SMV struct to another with a different floating point type, for all combinations of floating point types.
/// </summary>
/// <param name="S">Used for basis vector names and output language.</param>
/// <param name="cgd">Intermediate data for code generation. Also contains plugins and cog.</param>
public static void WriteSetCopyCrossFloat(Specification S, G25.CG.Shared.CGdata cgd, G25.FloatType dstFT, G25.SMV smv)
{
foreach (G25.FloatType srcFT in S.m_floatTypes)
{
if (srcFT.type == dstFT.type) continue;
cgd.m_defSB.AppendLine("");
//string srcClassName = srcFT.GetMangledName(smv.Name);
//string dstClassName = dstFT.GetMangledName(S, smv.Name);
string funcName = GMV.GetSetFuncName(S);
bool mustCast = dstFT.MustCastIfAssigned(S, srcFT);
G25.fgs F = new G25.fgs(funcName, funcName, "", new String[] { smv.Name }, null, new String[] { srcFT.type }, null, null, null); // null, null, null = metricName, comment, options
F.InitArgumentPtrFromTypeNames(S);
bool computeMultivectorValue = false;
int nbArgs = 1;
G25.CG.Shared.FuncArgInfo[] FAI = G25.CG.Shared.FuncArgInfo.GetAllFuncArgInfo(S, F, nbArgs, srcFT, null, computeMultivectorValue);
RefGA.Multivector value = G25.CG.Shared.Symbolic.SMVtoSymbolicMultivector(S, smv, FAI[0].Name, FAI[0].Pointer);
string dstName = G25.CG.Shared.SmvUtil.THIS;
bool dstPtr = false;
bool staticFunc = false;
G25.CG.Shared.Functions.WriteAssignmentFunction(S, cgd,
S.m_inlineSet, staticFunc, "void", null, funcName, null, FAI, dstFT, mustCast, smv, dstName, dstPtr, value);
}
}