Class TypeInfo
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeInfo
- All Implemented Interfaces:
Proxy
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 Summary
ConstructorsConstructorDescriptionTypeInfo()Allocate a new TypeInfo.TypeInfo(short classSize, @Nullable BaseInitFunc baseInit, @Nullable BaseFinalizeFunc baseFinalize, @Nullable ClassInitFunc classInit, @Nullable ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, @Nullable InstanceInitFunc instanceInit, TypeValueTable valueTable) Allocate a new TypeInfo with the fields set to the provided values.TypeInfo(short classSize, @Nullable BaseInitFunc baseInit, @Nullable BaseFinalizeFunc baseFinalize, @Nullable ClassInitFunc classInit, @Nullable ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, @Nullable InstanceInitFunc instanceInit, TypeValueTable valueTable, Arena arena) Allocate a new TypeInfo with the fields set to the provided values.Allocate a new TypeInfo.TypeInfo(MemorySegment address) Create a TypeInfo proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayoutThe memory layout of the native struct.@Nullable BaseFinalizeFuncRead the value of the fieldbase_finalize.@Nullable BaseInitFuncRead the value of the fieldbase_init.Read the value of the fieldclass_data.@Nullable ClassFinalizeFuncRead the value of the fieldclass_finalize.@Nullable ClassInitFuncRead the value of the fieldclass_init.shortRead the value of the fieldclass_size.@Nullable InstanceInitFuncRead the value of the fieldinstance_init.shortRead the value of the fieldinstance_size.shortRead the value of the fieldn_preallocs.Read the value of the fieldvalue_table.voidwriteBaseFinalize(@Nullable BaseFinalizeFunc baseFinalize, Arena _arena) Write a value in the fieldbase_finalize.voidwriteBaseInit(@Nullable BaseInitFunc baseInit, Arena _arena) Write a value in the fieldbase_init.voidwriteClassData(MemorySegment classData) Write a value in the fieldclass_data.voidwriteClassFinalize(@Nullable ClassFinalizeFunc classFinalize, Arena _arena) Write a value in the fieldclass_finalize.voidwriteClassInit(@Nullable ClassInitFunc classInit, Arena _arena) Write a value in the fieldclass_init.voidwriteClassSize(short classSize) Write a value in the fieldclass_size.voidwriteInstanceInit(@Nullable InstanceInitFunc instanceInit, Arena _arena) Write a value in the fieldinstance_init.voidwriteInstanceSize(short instanceSize) Write a value in the fieldinstance_size.voidwriteNPreallocs(short nPreallocs) Write a value in the fieldn_preallocs.voidwriteValueTable(TypeValueTable valueTable) Write a value in the fieldvalue_table.Methods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
TypeInfo
Create a TypeInfo proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
TypeInfo
Allocate a new TypeInfo.- Parameters:
arena- to control the memory allocation scope
-
TypeInfo
public TypeInfo()Allocate a new TypeInfo. The memory is allocated withArena.ofAuto(). -
TypeInfo
public TypeInfo(short classSize, @Nullable BaseInitFunc baseInit, @Nullable BaseFinalizeFunc baseFinalize, @Nullable ClassInitFunc classInit, @Nullable ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, @Nullable InstanceInitFunc instanceInit, TypeValueTable valueTable, Arena arena) Allocate a new TypeInfo with the fields set to the provided values.- Parameters:
classSize- value for the fieldclassSizebaseInit- value for the fieldbaseInitbaseFinalize- value for the fieldbaseFinalizeclassInit- value for the fieldclassInitclassFinalize- value for the fieldclassFinalizeclassData- value for the fieldclassDatainstanceSize- value for the fieldinstanceSizenPreallocs- value for the fieldnPreallocsinstanceInit- value for the fieldinstanceInitvalueTable- value for the fieldvalueTablearena- to control the memory allocation scope
-
TypeInfo
public TypeInfo(short classSize, @Nullable BaseInitFunc baseInit, @Nullable BaseFinalizeFunc baseFinalize, @Nullable ClassInitFunc classInit, @Nullable ClassFinalizeFunc classFinalize, MemorySegment classData, short instanceSize, short nPreallocs, @Nullable InstanceInitFunc instanceInit, TypeValueTable valueTable) Allocate a new TypeInfo with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
classSize- value for the fieldclassSizebaseInit- value for the fieldbaseInitbaseFinalize- value for the fieldbaseFinalizeclassInit- value for the fieldclassInitclassFinalize- value for the fieldclassFinalizeclassData- value for the fieldclassDatainstanceSize- value for the fieldinstanceSizenPreallocs- value for the fieldnPreallocsinstanceInit- value for the fieldinstanceInitvalueTable- value for the fieldvalueTable
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readClassSize
public short readClassSize()Read the value of the fieldclass_size.- Returns:
- The value of the field
class_size
-
writeClassSize
public void writeClassSize(short classSize) Write a value in the fieldclass_size.- Parameters:
classSize- The new value for the fieldclass_size
-
readBaseInit
Read the value of the fieldbase_init.- Returns:
- The value of the field
base_init
-
writeBaseInit
Write a value in the fieldbase_init.- Parameters:
baseInit- The new value for the fieldbase_init_arena- to control the memory allocation scope
-
readBaseFinalize
Read the value of the fieldbase_finalize.- Returns:
- The value of the field
base_finalize
-
writeBaseFinalize
Write a value in the fieldbase_finalize.- Parameters:
baseFinalize- The new value for the fieldbase_finalize_arena- to control the memory allocation scope
-
readClassInit
Read the value of the fieldclass_init.- Returns:
- The value of the field
class_init
-
writeClassInit
Write a value in the fieldclass_init.- Parameters:
classInit- The new value for the fieldclass_init_arena- to control the memory allocation scope
-
readClassFinalize
Read the value of the fieldclass_finalize.- Returns:
- The value of the field
class_finalize
-
writeClassFinalize
Write a value in the fieldclass_finalize.- Parameters:
classFinalize- The new value for the fieldclass_finalize_arena- to control the memory allocation scope
-
readClassData
Read the value of the fieldclass_data.- Returns:
- The value of the field
class_data
-
writeClassData
Write a value in the fieldclass_data.- Parameters:
classData- The new value for the fieldclass_data
-
readInstanceSize
public short readInstanceSize()Read the value of the fieldinstance_size.- Returns:
- The value of the field
instance_size
-
writeInstanceSize
public void writeInstanceSize(short instanceSize) Write a value in the fieldinstance_size.- Parameters:
instanceSize- The new value for the fieldinstance_size
-
readNPreallocs
public short readNPreallocs()Read the value of the fieldn_preallocs.- Returns:
- The value of the field
n_preallocs
-
writeNPreallocs
public void writeNPreallocs(short nPreallocs) Write a value in the fieldn_preallocs.- Parameters:
nPreallocs- The new value for the fieldn_preallocs
-
readInstanceInit
Read the value of the fieldinstance_init.- Returns:
- The value of the field
instance_init
-
writeInstanceInit
Write a value in the fieldinstance_init.- Parameters:
instanceInit- The new value for the fieldinstance_init_arena- to control the memory allocation scope
-
readValueTable
Read the value of the fieldvalue_table.- Returns:
- The value of the field
value_table
-
writeValueTable
Write a value in the fieldvalue_table.- Parameters:
valueTable- The new value for the fieldvalue_table
-