1
/*******************************************************************************
2
* Copyright (c) 2005 QnX Software Systems and others.
3
* All rights reserved. This program and the accompanying materials
4
* are made available under the terms of the Eclipse Public License v1.0
5
* which accompanies this distribution, and is available at
6
* http://www.eclipse.org/legal/epl-v10.html
9
* Qnx Software Systems - initial API and implementation
10
*******************************************************************************/
12
package org.eclipse.cdt.internal.core.model;
14
import org.eclipse.cdt.core.model.CModelException;
15
import org.eclipse.cdt.core.model.ICElement;
16
import org.eclipse.cdt.core.model.IMethodTemplateDeclaration;
18
public class MethodTemplateDeclaration extends MethodDeclaration implements IMethodTemplateDeclaration {
20
protected Template fTemplate;
22
public MethodTemplateDeclaration(ICElement parent, String name) {
23
super(parent, name, ICElement.C_TEMPLATE_METHOD_DECLARATION);
24
fTemplate = new Template(name);
27
public String[] getTemplateParameterTypes() {
28
return fTemplate.getTemplateParameterTypes();
31
public String getTemplateSignature() throws CModelException {
32
StringBuffer sig = new StringBuffer(fTemplate.getTemplateSignature());
33
sig.append(this.getParameterClause());
35
sig.append(" const"); //$NON-NLS-1$
37
sig.append(" volatile"); //$NON-NLS-1$
39
if((this.getReturnType() != null) && (this.getReturnType().length() > 0)){
40
sig.append(" : "); //$NON-NLS-1$
41
sig.append(this.getReturnType());
44
return sig.toString();
48
public int getNumberOfTemplateParameters() {
49
return fTemplate.getNumberOfTemplateParameters();
53
* Sets the fParameterTypes.
54
* @param templateParameterTypes The template parameter types to set
56
public void setTemplateParameterTypes(String[] templateParameterTypes) {
57
fTemplate.setTemplateParameterTypes(templateParameterTypes);