Class TypeCValue
java.lang.Object
org.javagi.base.ProxyInstance
org.gnome.gobject.TypeCValue
- All Implemented Interfaces:
Proxy
A union holding one collected value.
-
Constructor Summary
ConstructorsConstructorDescriptionAllocate a new TypeCValue.TypeCValue(int vInt, int vLong, long vInt64, double vDouble, MemorySegment vPointer) Allocate a new TypeCValue with the fields set to the provided values.TypeCValue(int vInt, int vLong, long vInt64, double vDouble, MemorySegment vPointer, Arena arena) Allocate a new TypeCValue with the fields set to the provided values.TypeCValue(Arena arena) Allocate a new TypeCValue.TypeCValue(MemorySegment address) Create a TypeCValue proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionstatic MemoryLayoutThe memory layout of the native struct.doubleRead the value of the fieldv_double.intreadVInt()Read the value of the fieldv_int.longRead the value of the fieldv_int64.intRead the value of the fieldv_long.Read the value of the fieldv_pointer.voidwriteVDouble(double vDouble) Write a value in the fieldv_double.voidwriteVInt(int vInt) Write a value in the fieldv_int.voidwriteVInt64(long vInt64) Write a value in the fieldv_int64.voidwriteVLong(int vLong) Write a value in the fieldv_long.voidwriteVPointer(MemorySegment vPointer) Write a value in the fieldv_pointer.Methods inherited from class ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
TypeCValue
Create a TypeCValue proxy instance for the provided memory address.- Parameters:
address- the memory address of the native object
-
TypeCValue
Allocate a new TypeCValue.- Parameters:
arena- to control the memory allocation scope
-
TypeCValue
public TypeCValue()Allocate a new TypeCValue. The memory is allocated withArena.ofAuto(). -
TypeCValue
public TypeCValue(int vInt, int vLong, long vInt64, double vDouble, MemorySegment vPointer, Arena arena) Allocate a new TypeCValue with the fields set to the provided values.- Parameters:
vInt- value for the fieldvIntvLong- value for the fieldvLongvInt64- value for the fieldvInt64vDouble- value for the fieldvDoublevPointer- value for the fieldvPointerarena- to control the memory allocation scope
-
TypeCValue
Allocate a new TypeCValue with the fields set to the provided values. The memory is allocated withArena.ofAuto().- Parameters:
vInt- value for the fieldvIntvLong- value for the fieldvLongvInt64- value for the fieldvInt64vDouble- value for the fieldvDoublevPointer- value for the fieldvPointer
-
-
Method Details
-
getMemoryLayout
The memory layout of the native struct.- Returns:
- the memory layout
-
readVInt
public int readVInt()Read the value of the fieldv_int.- Returns:
- The value of the field
v_int
-
writeVInt
public void writeVInt(int vInt) Write a value in the fieldv_int.- Parameters:
vInt- The new value for the fieldv_int
-
readVLong
public int readVLong()Read the value of the fieldv_long.- Returns:
- The value of the field
v_long
-
writeVLong
public void writeVLong(int vLong) Write a value in the fieldv_long.- Parameters:
vLong- The new value for the fieldv_long
-
readVInt64
public long readVInt64()Read the value of the fieldv_int64.- Returns:
- The value of the field
v_int64
-
writeVInt64
public void writeVInt64(long vInt64) Write a value in the fieldv_int64.- Parameters:
vInt64- The new value for the fieldv_int64
-
readVDouble
public double readVDouble()Read the value of the fieldv_double.- Returns:
- The value of the field
v_double
-
writeVDouble
public void writeVDouble(double vDouble) Write a value in the fieldv_double.- Parameters:
vDouble- The new value for the fieldv_double
-
readVPointer
Read the value of the fieldv_pointer.- Returns:
- The value of the field
v_pointer
-
writeVPointer
Write a value in the fieldv_pointer.- Parameters:
vPointer- The new value for the fieldv_pointer
-