All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dds.dealPBN Maven / Gradle / Ivy

// Generated by jextract

package dds;

import java.lang.invoke.MethodHandle;
import java.lang.invoke.VarHandle;
import java.nio.ByteOrder;
import java.lang.foreign.*;
import static java.lang.foreign.ValueLayout.*;
/**
 * {@snippet :
 * struct dealPBN {
 *     int trump;
 *     int first;
 *     int currentTrickSuit[3];
 *     int currentTrickRank[3];
 *     char remainCards[80];
 * };
 * }
 */
public class dealPBN {

    public static MemoryLayout $LAYOUT() {
        return constants$1.const$0;
    }
    public static VarHandle trump$VH() {
        return constants$1.const$1;
    }
    /**
     * Getter for field:
     * {@snippet :
     * int trump;
     * }
     */
    public static int trump$get(MemorySegment seg) {
        return (int)constants$1.const$1.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * int trump;
     * }
     */
    public static void trump$set(MemorySegment seg, int x) {
        constants$1.const$1.set(seg, x);
    }
    public static int trump$get(MemorySegment seg, long index) {
        return (int)constants$1.const$1.get(seg.asSlice(index*sizeof()));
    }
    public static void trump$set(MemorySegment seg, long index, int x) {
        constants$1.const$1.set(seg.asSlice(index*sizeof()), x);
    }
    public static VarHandle first$VH() {
        return constants$1.const$2;
    }
    /**
     * Getter for field:
     * {@snippet :
     * int first;
     * }
     */
    public static int first$get(MemorySegment seg) {
        return (int)constants$1.const$2.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * int first;
     * }
     */
    public static void first$set(MemorySegment seg, int x) {
        constants$1.const$2.set(seg, x);
    }
    public static int first$get(MemorySegment seg, long index) {
        return (int)constants$1.const$2.get(seg.asSlice(index*sizeof()));
    }
    public static void first$set(MemorySegment seg, long index, int x) {
        constants$1.const$2.set(seg.asSlice(index*sizeof()), x);
    }
    public static MemorySegment currentTrickSuit$slice(MemorySegment seg) {
        return seg.asSlice(8, 12);
    }
    public static MemorySegment currentTrickRank$slice(MemorySegment seg) {
        return seg.asSlice(20, 12);
    }
    public static MemorySegment remainCards$slice(MemorySegment seg) {
        return seg.asSlice(32, 80);
    }
    public static long sizeof() { return $LAYOUT().byteSize(); }
    public static MemorySegment allocate(SegmentAllocator allocator) { return allocator.allocate($LAYOUT()); }
    public static MemorySegment allocateArray(long len, SegmentAllocator allocator) {
        return allocator.allocate(MemoryLayout.sequenceLayout(len, $LAYOUT()));
    }
    public static MemorySegment ofAddress(MemorySegment addr, Arena arena) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, arena); }
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy