summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java')
-rw-r--r--core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java28
1 files changed, 27 insertions, 1 deletions
diff --git a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java
index 35b992c..82e2b9f 100644
--- a/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java
+++ b/core/org.eclipse.cdt.core/parser/org/eclipse/cdt/internal/core/pdom/dom/cpp/PDOMCPPClassSpecialization.java
@@ -10,6 +10,7 @@
* Andrew Ferguson (Symbian)
* Markus Schorn (Wind River Systems)
* Sergey Prigogin (Google)
+ * Thomas Corbat (IFS)
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom.cpp;
@@ -57,12 +58,13 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
ICPPClassSpecialization, IPDOMMemberOwner, IPDOMCPPClassType {
private static final int FIRST_BASE = PDOMCPPSpecialization.RECORD_SIZE + 0;
private static final int MEMBER_LIST = PDOMCPPSpecialization.RECORD_SIZE + 4;
+ private static final int FINAL = PDOMCPPSpecialization.RECORD_SIZE + 8; // byte
/**
* The size in bytes of a PDOMCPPClassSpecialization record in the database.
*/
@SuppressWarnings("hiding")
- protected static final int RECORD_SIZE = PDOMCPPSpecialization.RECORD_SIZE + 8;
+ protected static final int RECORD_SIZE = PDOMCPPSpecialization.RECORD_SIZE + 9;
private volatile ICPPClassScope fScope;
private ObjectMap specializationMap; // Obtained from the synchronized PDOM cache
@@ -71,6 +73,7 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
public PDOMCPPClassSpecialization(PDOMLinkage linkage, PDOMNode parent, ICPPClassType classType,
PDOMBinding specialized) throws CoreException {
super(linkage, parent, (ICPPSpecialization) classType, specialized);
+ setFinal(classType);
}
public PDOMCPPClassSpecialization(PDOMLinkage linkage, long bindingRecord) {
@@ -78,6 +81,15 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
}
@Override
+ public void update(PDOMLinkage linkage, IBinding newBinding) throws CoreException {
+ if (newBinding instanceof ICPPClassType) {
+ ICPPClassType ct= (ICPPClassType) newBinding;
+ setFinal(ct);
+ super.update(linkage, newBinding);
+ }
+ }
+
+ @Override
protected int getRecordSize() {
return RECORD_SIZE;
}
@@ -435,4 +447,18 @@ class PDOMCPPClassSpecialization extends PDOMCPPSpecialization implements
public boolean isAnonymous() {
return false;
}
+
+ @Override
+ public boolean isFinal() {
+ try {
+ return getDB().getByte(record + FINAL) != 0;
+ } catch (CoreException e){
+ CCorePlugin.log(e);
+ return false;
+ }
+ }
+
+ private void setFinal(ICPPClassType ct) throws CoreException {
+ getDB().putByte(record + FINAL, (byte) (ct.isFinal() ? 1 : 0));
+ }
}