Class FunctionDescriptorBuilder
java.lang.Object
express.mvp.roray.utils.functions.FunctionDescriptorBuilder
Fluent builder for
FunctionDescriptor - all costs are paid at setup time. Zero runtime
overhead as this produces standard FunctionDescriptor instances.
Example usage:
FunctionDescriptor desc = FunctionDescriptorBuilder.returnsInt()
.args(ValueLayout.ADDRESS, ValueLayout.JAVA_INT)
.build();
-
Method Summary
Modifier and TypeMethodDescriptionarg(MemoryLayout layout) Add a single argument layout.args(MemoryLayout... layouts) Add argument layouts to this descriptor.build()Build theFunctionDescriptor.static FunctionDescriptorBuilderreturns(MemoryLayout layout) Start building a descriptor with the specified return layout.static FunctionDescriptorBuilderStart building a descriptor that returns an int (C int, 32-bit).static FunctionDescriptorBuilderStart building a descriptor that returns a long (C long on Linux x86_64, 64-bit).static FunctionDescriptorBuilderStart building a descriptor that returns a pointer.static FunctionDescriptorBuilderStart building a descriptor that returns void.
-
Method Details
-
returns
Start building a descriptor with the specified return layout. -
returnsVoid
Start building a descriptor that returns void. -
returnsInt
Start building a descriptor that returns an int (C int, 32-bit). -
returnsLong
Start building a descriptor that returns a long (C long on Linux x86_64, 64-bit). -
returnsPointer
Start building a descriptor that returns a pointer. -
args
Add argument layouts to this descriptor. -
arg
Add a single argument layout. -
build
Build theFunctionDescriptor.
-