本文整理汇总了C#中ClassTemplate类的典型用法代码示例。如果您正苦于以下问题:C# ClassTemplate类的具体用法?C# ClassTemplate怎么用?C# ClassTemplate使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ClassTemplate类属于命名空间,在下文中一共展示了ClassTemplate类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
if (!base.VisitClassTemplateDecl(template))
return false;
template.Specializations.RemoveAll(
s => s.Fields.Any(f => f.Type.IsPrimitiveType(PrimitiveType.Void)));
if (template.Specializations.Count == 0)
return false;
var groups = (from specialization in template.Specializations
group specialization by specialization.Arguments.All(
a => a.Type.Type != null && a.Type.Type.IsAddress()) into @group
select @group).ToList();
var lastGroup = groups.Last();
if (lastGroup.Key)
{
foreach (var specialization in lastGroup.Skip(1))
template.Specializations.Remove(specialization);
}
return true;
}
开发者ID:acklinr,项目名称:CppSharp,代码行数:25,代码来源:TrimSpecializationsPass.cs
示例2: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
if (!base.VisitClassTemplateDecl(template) || template.IsIncomplete)
return false;
template.Specializations.RemoveAll(
s => s.Fields.Any(f => f.Type.IsPrimitiveType(PrimitiveType.Void)));
if (template.Specializations.Count == 0)
return false;
var groups = (from specialization in template.Specializations
group specialization by specialization.Arguments.All(
a => a.Type.Type != null && a.Type.Type.IsAddress()) into @group
select @group).ToList();
foreach (var group in groups.Where(g => g.Key))
foreach (var specialization in group.Skip(1))
template.Specializations.Remove(specialization);
for (int i = template.Specializations.Count - 1; i >= 0; i--)
if (template.Specializations[i] is ClassTemplatePartialSpecialization)
template.Specializations.RemoveAt(i);
return true;
}
开发者ID:ymlai87416,项目名称:CppSharp,代码行数:26,代码来源:TrimSpecializationsPass.cs
示例3: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
if (!base.VisitClassTemplateDecl(template))
return false;
// templates are not supported yet
foreach (var specialization in template.Specializations)
specialization.ExplicitlyIgnore();
return true;
}
开发者ID:acklinr,项目名称:CppSharp,代码行数:11,代码来源:CheckIgnoredDecls.cs
示例4: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
if (!base.VisitClassTemplateDecl(template))
return false;
EnsureCompleteDeclaration(template.TemplatedDecl);
template.TemplatedDecl = template.TemplatedDecl.CompleteDeclaration ?? template.TemplatedDecl;
return true;
}
开发者ID:xistoso,项目名称:CppSharp,代码行数:11,代码来源:ResolveIncompleteDeclsPass.cs
示例5: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
if (!base.VisitClassTemplateDecl(template))
return false;
if (!Driver.Options.IsCLIGenerator && template.IsSupportedStdType())
return false;
// templates are not supported yet
foreach (var specialization in template.Specializations)
specialization.ExplicitlyIgnore();
return true;
}
开发者ID:tritao,项目名称:CppSharp,代码行数:14,代码来源:CheckIgnoredDecls.cs
示例6: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
if (!base.VisitClassTemplateDecl(template))
return false;
EnsureCompleteDeclaration(template.TemplatedDecl);
template.TemplatedDecl = template.TemplatedDecl.CompleteDeclaration ?? template.TemplatedDecl;
// store all spesializations in the real template class because ClassTemplateDecl only forwards
foreach (var specialization in template.Specializations.Where(
s => !s.IsIncomplete && !template.TemplatedClass.Specializations.Contains(s)))
template.TemplatedClass.Specializations.Add(specialization);
return true;
}
开发者ID:ddobrev,项目名称:CppSharp,代码行数:15,代码来源:ResolveIncompleteDeclsPass.cs
示例7: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
if (!base.VisitClassTemplateDecl(template) ||
template.Specializations.Count == 0 ||
template.Specializations.All(s => s is ClassTemplatePartialSpecialization))
return false;
var @class = template.TemplatedDecl.Namespace as Class;
if (@class == null || @class is ClassTemplateSpecialization ||
@class.Namespace is Class)
return false;
if (movedClassTemplates.ContainsKey(@class.Namespace))
movedClassTemplates[@class.Namespace].Add(template);
else
movedClassTemplates.Add(@class.Namespace, new List<ClassTemplate> { template });
return true;
}
开发者ID:ymlai87416,项目名称:CppSharp,代码行数:19,代码来源:MoveNestedTemplateInternalsPass.cs
示例8: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
if (!base.VisitClassTemplateDecl(template))
return false;
if (template.IsIncomplete)
{
var completeDeclaration = (ClassTemplate) template.CompleteDeclaration;
foreach (var specialization in template.Specializations.Where(
spec => completeDeclaration.Specializations.All(s => s.USR != spec.USR)))
{
specialization.TemplatedDecl = completeDeclaration;
completeDeclaration.Specializations.Add(specialization);
}
}
EnsureCompleteDeclaration(template.TemplatedDecl);
template.TemplatedDecl = template.TemplatedDecl.CompleteDeclaration ?? template.TemplatedDecl;
return true;
}
开发者ID:ymlai87416,项目名称:CppSharp,代码行数:22,代码来源:ResolveIncompleteDeclsPass.cs
示例9: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
var expansions = template.PreprocessedEntities.OfType<MacroExpansion>();
var expansion = expansions.FirstOrDefault(e => e.Text.StartsWith(Prefix + "_CONSTRAINT"));
if (expansion != null)
{
var args = GetArguments(expansion.Text);
for (var i = 0; i < template.Parameters.Count && i < args.Length; ++i)
{
var param = template.Parameters[i];
param.Constraint = args[i];
template.Parameters[i] = param;
}
}
return base.VisitClassTemplateDecl(template);
}
开发者ID:corefan,项目名称:CppSharp,代码行数:18,代码来源:CheckMacrosPass.cs
示例10: ClassTemplate
internal ClassTemplate(ClassTemplate.Internal native)
: this(&native)
{
}
开发者ID:kidleon,项目名称:CppSharp,代码行数:4,代码来源:AST.cs
示例11: ClassTemplate
private ClassTemplate(ClassTemplate.Internal native)
: this(__CopyValue(native))
{
__ownsNativeInstance = true;
}
开发者ID:KonajuGames,项目名称:CppSharp,代码行数:5,代码来源:AST.cs
示例12: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
CheckForTemplateConstraints(template);
return base.VisitClassTemplateDecl(template);
}
开发者ID:ddobrev,项目名称:CppSharp,代码行数:6,代码来源:CheckMacrosPass.cs
示例13: ClassTemplate
private ClassTemplate(ClassTemplate.Internal native)
: this(__CopyValue(native))
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
开发者ID:RainsSoft,项目名称:CppSharp,代码行数:6,代码来源:AST.cs
示例14: __CreateInstance
public static ClassTemplate __CreateInstance(ClassTemplate.Internal native)
{
return new ClassTemplate(native);
}
开发者ID:RainsSoft,项目名称:CppSharp,代码行数:4,代码来源:AST.cs
示例15: ClassTemplate
private ClassTemplate(ClassTemplate.Internal native, bool skipVTables = false)
: this(__CopyValue(native), skipVTables)
{
__ownsNativeInstance = true;
NativeToManagedMap[__Instance] = this;
}
开发者ID:CSRedRat,项目名称:CppSharp,代码行数:6,代码来源:AST.cs
示例16: __CopyValue
private static void* __CopyValue(ClassTemplate.__Internal native)
{
var ret = Marshal.AllocHGlobal(156);
global::CppSharp.Parser.AST.ClassTemplate.__Internal.cctor_1(ret, new global::System.IntPtr(&native));
return ret.ToPointer();
}
开发者ID:ddobrev,项目名称:CppSharp,代码行数:6,代码来源:CppSharp.CppParser.cs
示例17: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
return template.TemplatedClass.Visit(this);
}
开发者ID:corefan,项目名称:CppSharp,代码行数:4,代码来源:CLIMarshal.cs
示例18: __CreateInstance
public static ClassTemplate __CreateInstance(ClassTemplate.Internal native, bool skipVTables = false)
{
return new ClassTemplate(native, skipVTables);
}
开发者ID:CSRedRat,项目名称:CppSharp,代码行数:4,代码来源:AST.cs
示例19: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
return false;
}
开发者ID:jijamw,项目名称:CppSharp,代码行数:4,代码来源:Types.cs
示例20: VisitClassTemplateDecl
public override bool VisitClassTemplateDecl(ClassTemplate template)
{
return VisitClassDecl(template.TemplatedClass);
}
开发者ID:fangsunjian,项目名称:CppSharp,代码行数:4,代码来源:CSharpMarshal.cs
注:本文中的ClassTemplate类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论