org.eclipse.cdt.core.dom.ast

## Interface ICompositeType

All Superinterfaces:
  Cloneable, org.eclipse.core.runtime.IAdaptable, IBinding, IType

All Known Subinterfaces:
  ICPPClassSpecialization, ICPPClassTemplate, ICPPClassTemplatePartialSpecialization, ICPPClassTemplatePartialSpecializationSpecialization, ICPPClassType, ICPPTemplateTemplateParameter

    public interface ICompositeType
    extends IBinding, IType

Interface for all composite types: classes, structs and unions.

Restriction:
  This interface is not intended to be implemented by clients.
Restriction:
  This interface is not intended to be extended by clients.

### Field Summary

Fields
`static int` `k_struct`
`static int` `k_union`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IBinding

`EMPTY_BINDING_ARRAY`

### Fields inherited from interface org.eclipse.cdt.core.dom.ast.IType

`EMPTY_TYPE_ARRAY, TYPE_MATCHER`

### Method Summary

All Methods Instance Methods Abstract Methods
`IField` `findField(String name)` Returns the field that matches name, or `null` if there is no such field.
`IScope` `getCompositeScope()` Returns the IScope object that is associated with this composite type.
`IField[]` `getFields()` Returns the fields for this type.
`int` `getKey()` Returns the type of the composite, `k_struct`, `k_union`, or `ICPPClassType.k_class`.
`boolean` `isAnonymous()` Returns whether the type is anonymous or not.

### Methods inherited from interface org.eclipse.cdt.core.dom.ast.IBinding

`getLinkage, getName, getNameCharArray, getOwner, getScope`

### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

`getAdapter`

### Methods inherited from interface org.eclipse.cdt.core.dom.ast.IType

`clone, isSameType`

### Field Detail

#### k_struct

    static final int k_struct

See Also:
  Constant Field Values

#### k_union

    static final int k_union

See Also:
  Constant Field Values

### Method Detail

#### getKey

    int getKey()

Returns the type of the composite, `k_struct`, `k_union`, or `ICPPClassType.k_class`.

#### isAnonymous

    boolean isAnonymous()

Returns whether the type is anonymous or not. A type for which objects or pointers are declared is not considered an anonymous type.

     struct Outer {
        struct {int a;}; // anonymous
        struct {int b;} c; // not anonymous
     }

Since:
  5.1

#### getFields

    IField[] getFields()

Returns the fields for this type.

Returns:
  List of IField

#### findField

    IField findField(String name)

Returns the field that matches name, or `null` if there is no such field.

Parameters:
  `name` -

#### getCompositeScope

    IScope getCompositeScope()

Returns the IScope object that is associated with this composite type.