示例#1
0
 public StructureTemplateHandle(ICElement parent, ICPPClassTemplate classTemplate)
     throws DOMException {
   super(parent, classTemplate);
   fTemplate = new Template(classTemplate.getName());
   ICPPTemplateParameter[] tpars = classTemplate.getTemplateParameters();
   String[] args = new String[tpars.length];
   for (int i = 0; i < args.length; i++) {
     args[i] = tpars[i].getName();
   }
   fTemplate.setTemplateInfo(null, args);
 }
 public CPPClassTemplatePartialSpecializationSpecialization(
     ICPPClassTemplatePartialSpecialization orig,
     ICPPTemplateParameterMap argumentMap,
     ICPPClassTemplate template,
     ICPPTemplateArgument[] args)
     throws DOMException {
   super(orig, template.getOwner(), argumentMap);
   fClassTemplate = template;
   fArguments = args;
 }
示例#3
0
 public StructureTemplateHandle(
     ICElement parent, ICPPClassSpecialization classBinding, ICPPClassTemplate ct)
     throws DOMException {
   super(parent, classBinding);
   fTemplate = new Template(classBinding.getName());
   ICPPTemplateParameterMap map = classBinding.getTemplateParameterMap();
   ICPPTemplateParameter[] tpars = ct.getTemplateParameters();
   List<String> args = new ArrayList<String>(tpars.length);
   for (ICPPTemplateParameter par : tpars) {
     if (par.isParameterPack()) {
       ICPPTemplateArgument[] pack = map.getPackExpansion(par);
       if (pack != null) {
         for (ICPPTemplateArgument p : pack) {
           args.add(ASTTypeUtil.getArgumentString(p, false));
         }
         continue;
       }
     }
     ICPPTemplateArgument arg = map.getArgument(par);
     args.add(arg == null ? par.getName() : ASTTypeUtil.getArgumentString(arg, false));
   }
   fTemplate.setTemplateInfo(null, args.toArray(new String[args.size()]));
 }