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


C# ClassTemplate类代码示例

本文整理汇总了C#中ClassTemplate的典型用法代码示例。如果您正苦于以下问题:C# ClassTemplate类的具体用法?C# ClassTemplate怎么用?C# ClassTemplate使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ClassTemplate类属于命名空间,在下文中一共展示了ClassTemplate类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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


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