Class TypeInfo

All Implemented Interfaces:
Proxy

@Generated("org.javagi.JavaGI") public class TypeInfo extends ProxyInstance

This structure is used to provide the type system with the information required to initialize and destruct (finalize) a type's class and its instances.

The initialized structure is passed to the g_type_register_static() function (or is copied into the provided GTypeInfo structure in the g_type_plugin_complete_type_info()). The type system will perform a deep copy of this structure, so its memory does not need to be persistent across invocation of g_type_register_static().

  • Constructor Details

    • TypeInfo

      public TypeInfo(MemorySegment address)
      Create a TypeInfo proxy instance for the provided memory address.
      Parameters:
      address - the memory address of the native object
    • TypeInfo

      public TypeInfo(Arena arena)
      Allocate a new TypeInfo.
      Parameters:
      arena - to control the memory allocation scope
    • TypeInfo

      public TypeInfo()
      Allocate a new TypeInfo. The memory is allocated with Arena.ofAuto().
    • TypeInfo

      public TypeInfo(short classSize, BaseInitFunc baseInit, BaseFinalizeFunc baseFinalize, ClassInitFunc classInit, ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, InstanceInitFunc instanceInit, TypeValueTable valueTable, Arena arena)
      Allocate a new TypeInfo with the fields set to the provided values.
      Parameters:
      classSize - value for the field classSize
      baseInit - value for the field baseInit
      baseFinalize - value for the field baseFinalize
      classInit - value for the field classInit
      classFinalize - value for the field classFinalize
      classData - value for the field classData
      instanceSize - value for the field instanceSize
      nPreallocs - value for the field nPreallocs
      instanceInit - value for the field instanceInit
      valueTable - value for the field valueTable
      arena - to control the memory allocation scope
    • TypeInfo

      public TypeInfo(short classSize, BaseInitFunc baseInit, BaseFinalizeFunc baseFinalize, ClassInitFunc classInit, ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, InstanceInitFunc instanceInit, TypeValueTable valueTable)
      Allocate a new TypeInfo with the fields set to the provided values. The memory is allocated with Arena.ofAuto().
      Parameters:
      classSize - value for the field classSize
      baseInit - value for the field baseInit
      baseFinalize - value for the field baseFinalize
      classInit - value for the field classInit
      classFinalize - value for the field classFinalize
      classData - value for the field classData
      instanceSize - value for the field instanceSize
      nPreallocs - value for the field nPreallocs
      instanceInit - value for the field instanceInit
      valueTable - value for the field valueTable
  • Method Details

    • getMemoryLayout

      public static MemoryLayout getMemoryLayout()
      The memory layout of the native struct.
      Returns:
      the memory layout
    • readClassSize

      public short readClassSize()
      Read the value of the field class_size.
      Returns:
      The value of the field class_size
    • writeClassSize

      public void writeClassSize(short classSize)
      Write a value in the field class_size.
      Parameters:
      classSize - The new value for the field class_size
    • readBaseInit

      public @Nullable BaseInitFunc readBaseInit()
      Read the value of the field base_init.
      Returns:
      The value of the field base_init
    • writeBaseInit

      public void writeBaseInit(@Nullable BaseInitFunc baseInit, Arena _arena)
      Write a value in the field base_init.
      Parameters:
      baseInit - The new value for the field base_init
      _arena - to control the memory allocation scope
    • readBaseFinalize

      public @Nullable BaseFinalizeFunc readBaseFinalize()
      Read the value of the field base_finalize.
      Returns:
      The value of the field base_finalize
    • writeBaseFinalize

      public void writeBaseFinalize(@Nullable BaseFinalizeFunc baseFinalize, Arena _arena)
      Write a value in the field base_finalize.
      Parameters:
      baseFinalize - The new value for the field base_finalize
      _arena - to control the memory allocation scope
    • readClassInit

      public @Nullable ClassInitFunc readClassInit()
      Read the value of the field class_init.
      Returns:
      The value of the field class_init
    • writeClassInit

      public void writeClassInit(@Nullable ClassInitFunc classInit, Arena _arena)
      Write a value in the field class_init.
      Parameters:
      classInit - The new value for the field class_init
      _arena - to control the memory allocation scope
    • readClassFinalize

      public @Nullable ClassFinalizeFunc readClassFinalize()
      Read the value of the field class_finalize.
      Returns:
      The value of the field class_finalize
    • writeClassFinalize

      public void writeClassFinalize(@Nullable ClassFinalizeFunc classFinalize, Arena _arena)
      Write a value in the field class_finalize.
      Parameters:
      classFinalize - The new value for the field class_finalize
      _arena - to control the memory allocation scope
    • readClassData

      public MemorySegment readClassData()
      Read the value of the field class_data.
      Returns:
      The value of the field class_data
    • writeClassData

      public void writeClassData(MemorySegment classData)
      Write a value in the field class_data.
      Parameters:
      classData - The new value for the field class_data
    • readInstanceSize

      public short readInstanceSize()
      Read the value of the field instance_size.
      Returns:
      The value of the field instance_size
    • writeInstanceSize

      public void writeInstanceSize(short instanceSize)
      Write a value in the field instance_size.
      Parameters:
      instanceSize - The new value for the field instance_size
    • readNPreallocs

      public short readNPreallocs()
      Read the value of the field n_preallocs.
      Returns:
      The value of the field n_preallocs
    • writeNPreallocs

      public void writeNPreallocs(short nPreallocs)
      Write a value in the field n_preallocs.
      Parameters:
      nPreallocs - The new value for the field n_preallocs
    • readInstanceInit

      public @Nullable InstanceInitFunc readInstanceInit()
      Read the value of the field instance_init.
      Returns:
      The value of the field instance_init
    • writeInstanceInit

      public void writeInstanceInit(@Nullable InstanceInitFunc instanceInit, Arena _arena)
      Write a value in the field instance_init.
      Parameters:
      instanceInit - The new value for the field instance_init
      _arena - to control the memory allocation scope
    • readValueTable

      public TypeValueTable readValueTable()
      Read the value of the field value_table.
      Returns:
      The value of the field value_table
    • writeValueTable

      public void writeValueTable(TypeValueTable valueTable)
      Write a value in the field value_table.
      Parameters:
      valueTable - The new value for the field value_table