Package jnr.ffi

Class StructLayout


  • public class StructLayout
    extends Type
    • Constructor Detail

      • StructLayout

        protected StructLayout​(Runtime runtime)
        Creates a new StructLayout.
        Parameters:
        runtime - The current runtime.
      • StructLayout

        protected StructLayout​(Runtime runtime,
                               int structSize)
    • Method Detail

      • getRuntime

        public final Runtime getRuntime()
      • size

        public final int size()
        Description copied from class: Type
        The size in bytes of this type.
        Specified by:
        size in class Type
        Returns:
        An integer
      • alignment

        public final int alignment()
        Description copied from class: Type
        The native alignment of this type, in bytes
        Specified by:
        alignment in class Type
        Returns:
        An integer
      • offset

        public final int offset()
      • getNativeType

        public NativeType getNativeType()
        Description copied from class: Type
        The native type of this type
        Specified by:
        getNativeType in class Type
        Returns:
        the native type of this type
      • toString

        public java.lang.String toString()
        Returns a human readable String representation of the structure.
        Overrides:
        toString in class java.lang.Object
        Returns:
        a String representation of this structure.
      • addField

        protected final int addField​(int size,
                                     int align)
      • addField

        protected final int addField​(int size,
                                     int align,
                                     StructLayout.Offset offset)
      • addField

        protected final int addField​(Type t)
      • arrayBegin

        protected final void arrayBegin()
        Starts an array construction session
      • arrayEnd

        protected final void arrayEnd()
        Ends an array construction session
      • array

        protected <T extends StructLayout.Field> T[] array​(T[] array)
        Creates an array of Member instances.
        Type Parameters:
        T - The type of the Member subclass to create.
        Parameters:
        array - the array to store the instances in
        Returns:
        the array that was passed in
      • inner

        protected final <T extends StructLayout> T inner​(T structLayout)