Class EcsScriptFunction
java.lang.Object
com.github.elebras1.flecs.EcsScriptFunction
struct EcsScriptFunction {
ecs_entity_t return_type;
ecs_vec_t params;
ecs_function_callback_t callback;
void *ctx;
}
-
Method Summary
Modifier and TypeMethodDescriptionstatic MemorySegmentallocate(SegmentAllocator allocator) Allocate a segment of sizelayout().byteSize()usingallocatorstatic MemorySegmentallocateArray(long elementCount, SegmentAllocator allocator) Allocate an array of sizeelementCountusingallocator.static MemorySegmentasSlice(MemorySegment array, long index) Obtains a slice ofarrayParamwhich selects the array element atindex.static MemorySegmentcallback(MemorySegment struct) Getter for field:ecs_function_callback_t callbackstatic voidcallback(MemorySegment struct, MemorySegment fieldValue) Setter for field:ecs_function_callback_t callbackstatic final AddressLayoutLayout for field:ecs_function_callback_t callbackstatic final longOffset for field:ecs_function_callback_t callbackstatic MemorySegmentctx(MemorySegment struct) Getter for field:void *ctxstatic voidctx(MemorySegment struct, MemorySegment fieldValue) Setter for field:void *ctxstatic final AddressLayoutLayout for field:void *ctxstatic final longOffset for field:void *ctxstatic final GroupLayoutlayout()The layout of this structstatic MemorySegmentparams(MemorySegment struct) Getter for field:ecs_vec_t paramsstatic voidparams(MemorySegment struct, MemorySegment fieldValue) Setter for field:ecs_vec_t paramsstatic final GroupLayoutLayout for field:ecs_vec_t paramsstatic final longOffset for field:ecs_vec_t paramsstatic MemorySegmentreinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any).static MemorySegmentreinterpret(MemorySegment addr, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any).static longreturn_type(MemorySegment struct) Getter for field:ecs_entity_t return_typestatic voidreturn_type(MemorySegment struct, long fieldValue) Setter for field:ecs_entity_t return_typestatic final ValueLayout.OfLongLayout for field:ecs_entity_t return_typestatic final longOffset for field:ecs_entity_t return_typestatic longsizeof()The size (in bytes) of this struct
-
Method Details
-
layout
The layout of this struct -
return_type$layout
Layout for field:ecs_entity_t return_type -
return_type$offset
public static final long return_type$offset()Offset for field:ecs_entity_t return_type -
return_type
Getter for field:ecs_entity_t return_type -
return_type
Setter for field:ecs_entity_t return_type -
params$layout
Layout for field:ecs_vec_t params -
params$offset
public static final long params$offset()Offset for field:ecs_vec_t params -
params
Getter for field:ecs_vec_t params -
params
Setter for field:ecs_vec_t params -
callback$layout
Layout for field:ecs_function_callback_t callback -
callback$offset
public static final long callback$offset()Offset for field:ecs_function_callback_t callback -
callback
Getter for field:ecs_function_callback_t callback -
callback
Setter for field:ecs_function_callback_t callback -
ctx$layout
Layout for field:void *ctx -
ctx$offset
public static final long ctx$offset()Offset for field:void *ctx -
ctx
Getter for field:void *ctx -
ctx
Setter for field:void *ctx -
asSlice
Obtains a slice ofarrayParamwhich selects the array element atindex. The returned segment has addressarrayParam.address() + index * layout().byteSize() -
sizeof
public static long sizeof()The size (in bytes) of this struct -
allocate
Allocate a segment of sizelayout().byteSize()usingallocator -
allocateArray
Allocate an array of sizeelementCountusingallocator. The returned segment has sizeelementCount * layout().byteSize(). -
reinterpret
public static MemorySegment reinterpret(MemorySegment addr, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any). The returned segment has sizelayout().byteSize() -
reinterpret
public static MemorySegment reinterpret(MemorySegment addr, long elementCount, Arena arena, Consumer<MemorySegment> cleanup) Reinterpretsaddrusing targetarenaandcleanupAction(if any). The returned segment has sizeelementCount * layout().byteSize()
-