1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-07-23 17:05:26 +02:00

Cosmetics.

This commit is contained in:
Sergey Prigogin 2013-10-21 15:39:29 -07:00
parent d722e6d367
commit d2b9c42395
2 changed files with 24 additions and 26 deletions

View file

@ -6,7 +6,7 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Andrew Ferguson (Symbian) - Initial implementation
* Andrew Ferguson (Symbian) - Initial implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.index.composite;
@ -18,20 +18,21 @@ import org.eclipse.cdt.internal.core.index.IIndexFragmentBinding;
import org.eclipse.cdt.internal.core.index.IIndexScope;
public interface ICompositesFactory {
public IIndexScope getCompositeScope(IIndexScope rscope);
/**
* Returns a composite (in the sense of potentially spanning multiple index fragments - i.e. not to be confused
* with ICompositeType) type for the specified type.
* Returns a composite (in the sense of potentially spanning multiple index fragments -
* i.e. not to be confused with ICompositeType) type for the specified type.
*/
public IType getCompositeType(IType rtype);
/**
* Returns a composite (index context carrying) binding for the specified binding. It does not
* matter which fragment the specified binding comes from
* @param binding a binding that will be used when searching for information to return from the composite
* binding methods
* matter which fragment the specified binding comes from.
*
* @param binding a binding that will be used when searching for information to return from
* the composite binding methods
* @return a composite (index context carrying) binding for the specified binding
*/
public IIndexBinding getCompositeBinding(IIndexFragmentBinding binding);

View file

@ -6,13 +6,10 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* Markus Schorn - initial API and implementation
*******************************************************************************/
* Markus Schorn - initial API and implementation
*******************************************************************************/
package org.eclipse.cdt.internal.core.pdom.dom;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.cdt.core.CCorePlugin;
import org.eclipse.cdt.core.index.IIndexFile;
import org.eclipse.cdt.core.index.IIndexMacro;
@ -24,25 +21,28 @@ import org.eclipse.cdt.internal.core.index.IIndexScope;
import org.eclipse.cdt.internal.core.pdom.db.Database;
import org.eclipse.core.runtime.CoreException;
import java.util.ArrayList;
import java.util.List;
/**
* A container collecting definitions and references for macros.
* @since 5.0
*/
public class PDOMMacroContainer extends PDOMNamedNode implements IIndexMacroContainer, IPDOMBinding {
private static final int FIRST_DEF_OFFSET = PDOMNamedNode.RECORD_SIZE + 0; // size 4
private static final int FIRST_REF_OFFSET = PDOMNamedNode.RECORD_SIZE + 4; // size 4
private static final int FIRST_DEF_OFFSET = PDOMNamedNode.RECORD_SIZE + 0; // size 4
private static final int FIRST_REF_OFFSET = PDOMNamedNode.RECORD_SIZE + 4; // size 4
@SuppressWarnings("hiding")
protected static final int RECORD_SIZE = PDOMNamedNode.RECORD_SIZE + 8;
public PDOMMacroContainer(PDOMLinkage linkage, char[] name) throws CoreException {
super(linkage, linkage, name);
}
PDOMMacroContainer(PDOMLinkage linkage, long record) {
super(linkage, record);
}
@Override
public int getNodeType() {
return IIndexBindingConstants.MACRO_CONTAINER;
@ -52,7 +52,7 @@ public class PDOMMacroContainer extends PDOMNamedNode implements IIndexMacroCont
protected int getRecordSize() {
return RECORD_SIZE;
}
public boolean isOrphaned() throws CoreException {
Database db = getDB();
return db.getRecPtr(record + FIRST_DEF_OFFSET) == 0
@ -67,7 +67,7 @@ public class PDOMMacroContainer extends PDOMNamedNode implements IIndexMacroCont
}
setFirstDefinition(name);
}
public void addReference(PDOMMacroReferenceName name) throws CoreException {
PDOMMacroReferenceName first = getFirstReference();
if (first != null) {
@ -76,22 +76,22 @@ public class PDOMMacroContainer extends PDOMNamedNode implements IIndexMacroCont
}
setFirstReference(name);
}
public PDOMMacro getFirstDefinition() throws CoreException {
long namerec = getDB().getRecPtr(record + FIRST_DEF_OFFSET);
return namerec != 0 ? new PDOMMacro(getLinkage(), namerec) : null;
}
void setFirstDefinition(PDOMMacro macro) throws CoreException {
long namerec = macro != null ? macro.getRecord() : 0;
getDB().putRecPtr(record + FIRST_DEF_OFFSET, namerec);
}
public PDOMMacroReferenceName getFirstReference() throws CoreException {
long namerec = getDB().getRecPtr(record + FIRST_REF_OFFSET);
return namerec != 0 ? new PDOMMacroReferenceName(getLinkage(), namerec) : null;
}
void setFirstReference(PDOMMacroReferenceName nextName) throws CoreException {
long namerec = nextName != null ? nextName.getRecord() : 0;
getDB().putRecPtr(record + FIRST_REF_OFFSET, namerec);
@ -119,9 +119,6 @@ public class PDOMMacroContainer extends PDOMNamedNode implements IIndexMacroCont
return IIndexBindingConstants.MACRO_CONTAINER;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.internal.core.index.IIndexFragmentBinding#getFragment()
*/
@Override
public IIndexFragment getFragment() {
return getPDOM();