Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: 2d1ec33a8e99da3047517c43b740c49ae5cd1948 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*******************************************************************************
 * Copyright (c) 2002, 2008 QNX Software Systems 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:
 * QNX Software Systems - Initial API and implementation
 *******************************************************************************/

package org.eclipse.cdt.internal.core.model;

import org.eclipse.cdt.core.model.CModelException;
import org.eclipse.cdt.core.model.ICElement;
import org.eclipse.cdt.core.model.IStructureDeclaration;

/**
 * StructureDeclaration
 */
public class StructureDeclaration extends SourceManipulation implements IStructureDeclaration {

	public StructureDeclaration(ICElement parent, String name, int kind) {
		super(parent, name, kind);
	}

	public String getTypeName() throws CModelException {
		return getStructureInfo().getTypeName();
	}

	public void setTypeName(String type) throws CModelException {
		getStructureInfo().setTypeName(type);
	}

	public boolean isUnion() throws CModelException {
		return getStructureInfo().isUnion();
	}

	public boolean isClass() throws CModelException {
		return getStructureInfo().isClass();
	}

	public boolean isStruct() throws CModelException {
		return getStructureInfo().isStruct();
	}

	public StructureInfo getStructureInfo() throws CModelException{
		return (StructureInfo) getElementInfo();
	}

	@Override
	protected CElementInfo createElementInfo () {
		return new StructureInfo(this);
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.core.model.IDeclaration#isStatic()
	 */
	public boolean isStatic() throws CModelException {
		return getStructureInfo().isStatic();
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.core.model.IDeclaration#isConst()
	 */
	public boolean isConst() throws CModelException {
		return getStructureInfo().isConst();
	}

	/* (non-Javadoc)
	 * @see org.eclipse.cdt.core.model.IDeclaration#isVolatile()
	 */
	public boolean isVolatile() throws CModelException {
		return getStructureInfo().isVolatile();
	}

}

Back to the top