Skip to main content
aboutsummaryrefslogtreecommitdiffstats
blob: e84bc82fd54acbb8e5ab4d6d7ab1b074d8c818eb (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
/*******************************************************************************
 * Copyright (c) 2005, 2009 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 - Initial API and implementation
 *    IBM Corporation
 *    Markus Schorn (Wind River Systems)
 *******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;

import org.eclipse.cdt.core.dom.ast.ICompositeType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPClassType;
import org.eclipse.cdt.core.dom.ast.cpp.ICPPField;
import org.eclipse.cdt.internal.core.index.IIndexCPPBindingConstants;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMLinkage;
import org.eclipse.cdt.internal.core.pdom.dom.PDOMNode;
import org.eclipse.core.runtime.CoreException;

/**
 * @author Doug Schaefer
 *
 */
class PDOMCPPField extends PDOMCPPVariable implements ICPPField {
	
	public PDOMCPPField(PDOMLinkage linkage, PDOMNode parent, ICPPField field)
			throws CoreException {
		super(linkage, parent, field);
	}		

	public PDOMCPPField(PDOMLinkage linkage, int bindingRecord) {
		super(linkage, bindingRecord);
	}

	// @Override
	@Override
	protected int getRecordSize() {
		return RECORD_SIZE;
	}
	
	// @Override
	@Override
	public int getNodeType() {
		return IIndexCPPBindingConstants.CPPFIELD;
	}
	
	public ICPPClassType getClassOwner() {
		return (ICPPClassType) getOwner();
	}

	public int getVisibility() {
		return PDOMCPPAnnotation.getVisibility(getByte(record + ANNOTATIONS));
	}

	// @Override
	@Override
	public boolean isMutable() {
		return getBit(getByte(record + ANNOTATIONS), PDOMCPPAnnotation.MUTABLE_OFFSET);
	}

	// @Override
	@Override
	public boolean isAuto() {
		// ISO/IEC 14882:2003 9.2.6
		return false; 
	}

	// @Override
	@Override
	public boolean isExtern() {
		// ISO/IEC 14882:2003 9.2.6
		return false; 
	}

	// @Override
	@Override
	public boolean isExternC() {
		return false; 
	}

	// @Override
	@Override
	public boolean isRegister() {
		// ISO/IEC 14882:2003 9.2.6
		return false; 
	}

	public ICompositeType getCompositeTypeOwner() {
		return getClassOwner();
	}
}

Back to the top