Package com.kenai.jffi
Class Type
java.lang.Object
com.kenai.jffi.Type
- Direct Known Subclasses:
Aggregate
,Type.Builtin
Native parameter and return types.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final class
Types that are built-in to libffi.(package private) static final class
This is a lazy loaded cache of builtin type info, so we can still have Type.VOID as a public static variable without it causing the native library to load. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
static final Type
The native double typestatic final Type
The native float typeprivate long
static final Type
The native long double typestatic final Type
The native memory address typestatic final Type
The native signed char typestatic final Type
The native signed integer typestatic final Type
The native signed 16 bit integer typestatic final Type
The native signed 32 bit integer typestatic final Type
The native signed 64 bit integer typestatic final Type
The native signed 8 bit integer typeprivate int
static final Type
The native signed long integer typestatic final Type
The native signed long long integer typestatic final Type
The native signed short integer typeprivate int
static final Type
The native unsigned char typestatic final Type
The native unsigned integer typestatic final Type
The native unsigned 16 bit integer typestatic final Type
The native unsigned 32 bit integer typestatic final Type
The native unsigned 64 bit integer typestatic final Type
The native unsigned 8 bit integer typestatic final Type
The native unsigned long integer typestatic final Type
The native unsigned long long integer typestatic final Type
The native unsigned short integer typestatic final Type
The native void type -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal int
Gets the alignment of this type.private static Type
builtin
(NativeType nativeType) Creates aType
instance for builtin types.boolean
(package private) abstract Type.TypeInfo
(package private) final long
handle()
Gets the native address of the ffi_type struct for thisType
int
hashCode()
(package private) static long[]
nativeHandles
(Type[] types) Converts an array ofType
objects into an array of pointers to ffi_type structures.(package private) static long[]
nativeHandles
(List<Type> types) Converts a list ofType
objects into an array of pointers to ffi_type structures.private int
private long
private int
private int
final int
size()
Gets the size of this type.final int
type()
Gets the FFI type enum value for thisType
-
Field Details
-
VOID
The native void type -
FLOAT
The native float type -
DOUBLE
The native double type -
LONGDOUBLE
The native long double type -
UINT8
The native unsigned 8 bit integer type -
SINT8
The native signed 8 bit integer type -
UINT16
The native unsigned 16 bit integer type -
SINT16
The native signed 16 bit integer type -
UINT32
The native unsigned 32 bit integer type -
SINT32
The native signed 32 bit integer type -
UINT64
The native unsigned 64 bit integer type -
SINT64
The native signed 64 bit integer type -
POINTER
The native memory address type -
UCHAR
The native unsigned char type -
SCHAR
The native signed char type -
USHORT
The native unsigned short integer type -
SSHORT
The native signed short integer type -
UINT
The native unsigned integer type -
SINT
The native signed integer type -
ULONG
The native unsigned long integer type -
SLONG
The native signed long integer type -
ULONG_LONG
The native unsigned long long integer type -
SLONG_LONG
The native signed long long integer type -
type
private int type -
size
private int size -
alignment
private int alignment -
handle
private volatile long handle
-
-
Constructor Details
-
Type
public Type()
-
-
Method Details
-
type
public final int type()Gets the FFI type enum value for thisType
- Returns:
- An integer representing the FFI type.
-
handle
final long handle()Gets the native address of the ffi_type struct for thisType
- Returns:
- The address of the ffi_type structure
-
size
public final int size()Gets the size of this type.- Returns:
- The size of this type, in bytes.
-
alignment
public final int alignment()Gets the alignment of this type.- Returns:
- The alignment of this type, in bytes.
-
resolveType
private int resolveType() -
resolveSize
private int resolveSize() -
resolveAlignment
private int resolveAlignment() -
resolveHandle
private long resolveHandle() -
getTypeInfo
-
equals
-
hashCode
public int hashCode() -
nativeHandles
Converts an array ofType
objects into an array of pointers to ffi_type structures.- Parameters:
types
- An array ofType
objects- Returns:
- An array of native ffi_type handles.
-
nativeHandles
Converts a list ofType
objects into an array of pointers to ffi_type structures.- Parameters:
types
- A list ofType
objects- Returns:
- An array of native ffi_type handles.
-
builtin
Creates aType
instance for builtin types.- Parameters:
nativeType
- The builtin type enum.- Returns:
- A
Type
instance.
-