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

org.purejava.appindicator._GDoubleIEEE754 Maven / Gradle / Ivy

There is a newer version: 1.4.2
Show newest version
// Generated by jextract

package org.purejava.appindicator;

import java.lang.foreign.Arena;
import java.lang.foreign.MemoryLayout;
import java.lang.foreign.MemorySegment;
import java.lang.foreign.SegmentAllocator;
import java.lang.invoke.VarHandle;
/**
 * {@snippet :
 * union _GDoubleIEEE754 {
 *     double v_double;
 *     struct  mpn;
 * };
 * }
 */
public class _GDoubleIEEE754 {

    public static MemoryLayout $LAYOUT() {
        return constants$16.const$1;
    }
    public static VarHandle v_double$VH() {
        return constants$16.const$2;
    }
    /**
     * Getter for field:
     * {@snippet :
     * double v_double;
     * }
     */
    public static double v_double$get(MemorySegment seg) {
        return (double)constants$16.const$2.get(seg);
    }
    /**
     * Setter for field:
     * {@snippet :
     * double v_double;
     * }
     */
    public static void v_double$set(MemorySegment seg, double x) {
        constants$16.const$2.set(seg, x);
    }
    public static double v_double$get(MemorySegment seg, long index) {
        return (double)constants$16.const$2.get(seg.asSlice(index*sizeof()));
    }
    public static void v_double$set(MemorySegment seg, long index, double x) {
        constants$16.const$2.set(seg.asSlice(index*sizeof()), x);
    }
    /**
     * {@snippet :
     * struct {
     *          *     unsigned int mantissa_low;
     *     unsigned int mantissa_high;
     *     unsigned int biased_exponent;
     *     unsigned int sign;
     * };
     * }
     */
    public static final class mpn {

        // Suppresses default constructor, ensuring non-instantiability.
        private mpn() {}
        public static MemoryLayout $LAYOUT() {
            return constants$16.const$3;
        }
        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 scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
    }

    public static MemorySegment mpn$slice(MemorySegment seg) {
        return seg.asSlice(0, 8);
    }
    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 scope) { return RuntimeHelper.asArray(addr, $LAYOUT(), 1, scope); }
}






© 2015 - 2025 Weber Informatics LLC | Privacy Policy