java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.field.StructDef<T>

public final class StructDef<T> extends Object
Defines a data structure that will appear in the database.

There are three mechanisms for deleting a struct from the database:

  • Explicit deletion. This happens synchronously via manual calls to Nd.delete. Structs intended for manual deletion have refCounted=false and an empty ownerFields.
  • Owner pointers. Such structs have one or more outbound pointers to an "owner" object. They are deleted asynchronously when the last owner pointer is deleted. The structs have refCounted=false and a nonempty ownerFields.
  • Refcounting. Such structs are deleted asynchronously when all elements are removed from all of their ManyToOne relationships which are not marked as incoming owner pointers. Owner relationships need to be excluded from refcounting since they would always create cycles. These structs have refCounted=true.

Structs deleted by refcounting and owner pointers are not intended to inherit from one another, but anything may inherit from a struct that uses manual deletion and anything may inherit from a struct that uses the same deletion mechanism.

  • Field Details

    • hasUserDestructor

      protected boolean hasUserDestructor
  • Method Details

    • addDependency

      public void addDependency(StructDef<?> newDependency)
    • getStructClass

      public Class<T> getStructClass()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • createAbstract

      public static <T> StructDef<T> createAbstract(Class<T> clazz)
    • createAbstract

      public static <T> StructDef<T> createAbstract(Class<T> clazz, StructDef<? super T> superClass)
    • create

      public static <T> StructDef<T> create(Class<T> clazz)
    • create

      public static <T> StructDef<T> create(Class<T> clazz, StructDef<? super T> superClass)
    • isReadyForDeletion

      protected boolean isReadyForDeletion(Nd dom, long address)
    • hasDestructableFields

      protected boolean hasDestructableFields()
    • getDeletionSemantics

      public StructDef.DeletionSemantics getDeletionSemantics()
    • done

      public void done()
      Call this once all the fields have been added to the struct definition and it is ready to use.
    • add

      public void add(IField toAdd)
    • addDestructableField

      public void addDestructableField(IDestructableField field)
    • useStandardRefCounting

      public StructDef<T> useStandardRefCounting()
    • addRefCountedField

      public void addRefCountedField(IRefCountedField result)
    • addOwnerField

      public void addOwnerField(IRefCountedField result)
    • areOffsetsComputed

      public boolean areOffsetsComputed()
    • size

      public int size()
    • addPointer

      public FieldPointer addPointer()
    • addShort

      public FieldShort addShort()
    • addInt

      public FieldInt addInt()
    • addLong

      public FieldLong addLong()
    • addString

      public FieldString addString()
    • addDouble

      public FieldDouble addDouble()
    • addFloat

      public FieldFloat addFloat()
    • getStructName

      public String getStructName()
    • addByte

      public FieldByte addByte()
    • addChar

      public FieldChar addChar()
    • add

      public <F> Field<F> add(ITypeFactory<F> factory1)
    • getFactory

      public ITypeFactory<T> getFactory()
    • isNdNode

      public boolean isNdNode()
    • getNumFields

      public int getNumFields()