summaryrefslogtreecommitdiffstats
blob: 27c19b5723f15e465aa18d2e4bcc95ef9463467c (plain)
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
/*******************************************************************************
 * Copyright (c) 2004, 2011 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:
 *     John Camelon (IBM) - Initial API and implementation
 *     Markus Schorn (Wind River Systems)
 *     Thomas Corbat (IFS)
******************************************************************************/
package org.eclipse.cdt.core.dom.ast.cpp;

import org.eclipse.cdt.core.dom.ast.ASTNodeProperty;
import org.eclipse.cdt.core.dom.ast.IASTCompositeTypeSpecifier;
import org.eclipse.cdt.core.dom.ast.IASTName;
import org.eclipse.cdt.core.dom.ast.IASTNameOwner;
import org.eclipse.cdt.core.dom.ast.IASTNode;

/**
 * @noextend This interface is not intended to be extended by clients.
 * @noimplement This interface is not intended to be implemented by clients.
 */
public interface ICPPASTCompositeTypeSpecifier extends IASTCompositeTypeSpecifier, ICPPASTDeclSpecifier {
	/**
	 * <code>k_class</code> C++ introduces the class concept for composite types.
	 */
	public static final int k_class = IASTCompositeTypeSpecifier.k_last + 1;

	/**
	 * <code>k_last</code> allows for subinterfaces to extend the kind type.
	 */
	public static final int k_last = k_class;

	/**
	 * <code>VISIBILITY_LABEL</code> is used to express the relationship for a
	 * visibility label "declaration".
	 */
	public static final ASTNodeProperty VISIBILITY_LABEL = new ASTNodeProperty(
			"ICPPASTCompositeTypeSpecifier.VISIBILITY_LABEL - Visibility label \"declaration\""); //$NON-NLS-1$

	/**
	 * <code>BASE_SPECIFIER</code> expresses the subclass role.
	 */
	public static final ASTNodeProperty BASE_SPECIFIER = new ASTNodeProperty(
			"ICPPASTCompositeTypeSpecifier.BASE_SPECIFIER - Expresses the subclass role"); //$NON-NLS-1$

	/**
	 * Base Specifiers are where a class expresses from whom it inherits.
	 * 
	 * @noimplement This interface is not intended to be implemented by clients.
	 */
	public static interface ICPPASTBaseSpecifier extends IASTNode, IASTNameOwner, ICPPASTPackExpandable {
		public static final ICPPASTBaseSpecifier[] EMPTY_BASESPECIFIER_ARRAY = {};

		/**
		 * Relation between base specifier and its name.
		 */
		public static final ASTNodeProperty NAME = new ASTNodeProperty(
				"ICPPASTBaseSpecifier.NAME - Name of base class"); //$NON-NLS-1$
		
		public static final int v_public = 1;
		public static final int v_protected = 2;
		public static final int v_private = 3;

		/**
		 * Returns whether this specifies a virtual base.
		 */
		public boolean isVirtual();

		/**
		 * Returns the accessibility for the base.
		 */
		public int getVisibility();

		/**
		 * Returns the name of this specifier.
		 */
		public IASTName getName();

		/**
		 * @since 5.1
		 */
		@Override
		public ICPPASTBaseSpecifier copy();
		
		/**
		 * @since 5.3
		 */
		@Override
		public ICPPASTBaseSpecifier copy(CopyStyle style);
		
		/**
		 * Sets the name for this specifier, not allowed on frozen AST.
		 */
		public void setName(IASTName name);
		
		/**
		 * Sets whether this specifier is for a virtual base. Not allowed on frozen AST.
		 */
		public void setVirtual(boolean value);

		/**
		 * Sets the visibility of this specifier, not allowed on frozen AST.
		 */
		public void setVisibility(int visibility);
	}

	/**
	 * Get the base specifiers.
	 * 
	 * @return <code>ICPPASTBaseSpecifier []</code>
	 */
	public ICPPASTBaseSpecifier[] getBaseSpecifiers();

	/**
	 * Add a base specifier.
	 * 
	 * @param baseSpec
	 *            <code>ICPPASTBaseSpecifier</code>
	 */
	public void addBaseSpecifier(ICPPASTBaseSpecifier baseSpec);

	/**
	 * @since 5.1
	 */
	@Override
	public ICPPClassScope getScope();
	
	/**
	 * @since 5.1
	 */
	@Override
	public ICPPASTCompositeTypeSpecifier copy();

	/**
	 * @since 5.3
	 */
	@Override
	public ICPPASTCompositeTypeSpecifier copy(CopyStyle style);

	/**
	 * Queries whether the type is final.
	 * @noreference This method is not intended to be referenced by clients.
	 */
	public boolean isFinal();

	/**
	 * Sets whether the type is final.
	 * @noreference This method is not intended to be referenced by clients.
	 */
	public void setFinal(boolean isFinal);
}