mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
bug 169134
This commit is contained in:
parent
481925b5dd
commit
6bb1949ce9
4 changed files with 43 additions and 11 deletions
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005, 2006 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -57,9 +57,9 @@ import org.eclipse.cdt.internal.core.dom.parser.cpp.CPPClassType.CPPClassTypePro
|
|||
* @author aniefer
|
||||
*/
|
||||
public class CPPClassTemplate extends CPPTemplateDefinition implements
|
||||
ICPPClassTemplate, ICPPClassType, ICPPInternalClassType {
|
||||
ICPPClassTemplate, ICPPClassType, ICPPInternalClassType, ICPPInternalClassTemplate {
|
||||
|
||||
public static class CPPClassTemplateDelegate extends CPPClassType.CPPClassTypeDelegate implements ICPPClassTemplate, ICPPInternalTemplate {
|
||||
public static class CPPClassTemplateDelegate extends CPPClassType.CPPClassTypeDelegate implements ICPPClassTemplate, ICPPInternalClassTemplate {
|
||||
public CPPClassTemplateDelegate( IASTName name, ICPPClassType cls ) {
|
||||
super( name, cls );
|
||||
}
|
||||
|
@ -81,6 +81,9 @@ public class CPPClassTemplate extends CPPTemplateDefinition implements
|
|||
public ICPPSpecialization getInstance( IType[] arguments ) {
|
||||
return ((ICPPInternalTemplate)getBinding()).getInstance( arguments );
|
||||
}
|
||||
public void addPartialSpecialization( ICPPClassTemplatePartialSpecialization spec ) {
|
||||
((ICPPInternalClassTemplate)getBinding()).addPartialSpecialization( spec );
|
||||
}
|
||||
}
|
||||
private ICPPClassTemplatePartialSpecialization [] partialSpecializations = null;
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -22,6 +22,7 @@ import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
|||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPScope;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPSpecialization;
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateParameter;
|
||||
import org.eclipse.cdt.core.parser.util.ArrayUtil;
|
||||
import org.eclipse.cdt.core.parser.util.ObjectMap;
|
||||
|
||||
/**
|
||||
|
@ -29,9 +30,10 @@ import org.eclipse.cdt.core.parser.util.ObjectMap;
|
|||
*
|
||||
*/
|
||||
public class CPPClassTemplateSpecialization extends CPPClassSpecialization
|
||||
implements ICPPClassTemplate, ICPPInternalTemplate {
|
||||
implements ICPPClassTemplate, ICPPInternalClassTemplate {
|
||||
|
||||
private ObjectMap instances = null;
|
||||
private ICPPClassTemplatePartialSpecialization [] partialSpecializations = null;
|
||||
|
||||
/**
|
||||
* @param specialized
|
||||
|
@ -47,10 +49,11 @@ public class CPPClassTemplateSpecialization extends CPPClassSpecialization
|
|||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplate#getPartialSpecializations()
|
||||
*/
|
||||
public ICPPClassTemplatePartialSpecialization[] getPartialSpecializations() {
|
||||
// TODO Auto-generated method stub
|
||||
return ICPPClassTemplatePartialSpecialization.EMPTY_PARTIAL_SPECIALIZATION_ARRAY;
|
||||
partialSpecializations = (ICPPClassTemplatePartialSpecialization[]) ArrayUtil.trim( ICPPClassTemplatePartialSpecialization.class, partialSpecializations );
|
||||
return partialSpecializations;
|
||||
}
|
||||
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.dom.ast.cpp.ICPPTemplateDefinition#getTemplateParameters()
|
||||
*/
|
||||
|
@ -99,4 +102,8 @@ public class CPPClassTemplateSpecialization extends CPPClassSpecialization
|
|||
// TODO Auto-generated method stub
|
||||
return null;
|
||||
}
|
||||
|
||||
public void addPartialSpecialization( ICPPClassTemplatePartialSpecialization spec ){
|
||||
partialSpecializations = (ICPPClassTemplatePartialSpecialization[]) ArrayUtil.append( ICPPClassTemplatePartialSpecialization.class, partialSpecializations, spec );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2005 IBM Corporation and others.
|
||||
* Copyright (c) 2005, 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
|
@ -358,7 +358,8 @@ public class CPPTemplates {
|
|||
}
|
||||
|
||||
spec = new CPPClassTemplatePartialSpecialization( id );
|
||||
((CPPClassTemplate)template).addPartialSpecialization( (ICPPClassTemplatePartialSpecialization) spec );
|
||||
if(template instanceof ICPPInternalClassTemplate)
|
||||
((ICPPInternalClassTemplate)template).addPartialSpecialization( (ICPPClassTemplatePartialSpecialization) spec );
|
||||
return spec;
|
||||
}
|
||||
|
||||
|
@ -1481,8 +1482,8 @@ public class CPPTemplates {
|
|||
}
|
||||
}
|
||||
|
||||
if( template instanceof CPPClassTemplate ){
|
||||
return ((CPPClassTemplate)template).instantiate( args );
|
||||
if( template instanceof ICPPInternalTemplate ){
|
||||
return ((ICPPInternalTemplate)template).instantiate( args );
|
||||
}
|
||||
return template;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*******************************************************************************
|
||||
* Copyright (c) 2007 IBM Corporation and others.
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*
|
||||
* Contributors:
|
||||
* IBM - Initial API and implementation
|
||||
*******************************************************************************/
|
||||
package org.eclipse.cdt.internal.core.dom.parser.cpp;
|
||||
|
||||
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassTemplatePartialSpecialization;
|
||||
|
||||
/**
|
||||
* @author aniefer
|
||||
*
|
||||
*/
|
||||
public interface ICPPInternalClassTemplate extends ICPPInternalTemplate {
|
||||
public void addPartialSpecialization( ICPPClassTemplatePartialSpecialization spec );
|
||||
}
|
Loading…
Add table
Reference in a new issue