Class YGValue

  • All Implemented Interfaces:
    java.lang.AutoCloseable, org.lwjgl.system.NativeResource, org.lwjgl.system.Pointer

    public class YGValue
    extends org.lwjgl.system.Struct
    implements org.lwjgl.system.NativeResource

    Layout

    
     struct YGValue {
         float value;
         YGUnit unit;
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  YGValue.Buffer
      An array of YGValue structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
      • Nested classes/interfaces inherited from class org.lwjgl.system.Struct

        org.lwjgl.system.Struct.StructValidation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int SIZEOF
      The struct size in bytes.
      static int UNIT
      VALUE
      The struct member offsets.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      YGValue​(java.nio.ByteBuffer container)
      Creates a YGValue instance at the current position of the specified ByteBuffer container.
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • VALUE, UNIT

        The struct member offsets.
    • Constructor Detail

      • YGValue

        public YGValue​(java.nio.ByteBuffer container)
        Creates a YGValue instance at the current position of the specified ByteBuffer container. Changes to the buffer's content will be visible to the struct instance and vice versa.

        The created instance holds a strong reference to the container object.

    • Method Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • value

        public float value()
        Returns:
        the value of the value field.
      • unit

        public int unit()
        Returns:
        the value of the unit field.
      • value

        public YGValue value​(float value)
        Sets the specified value to the value field.
      • unit

        public YGValue unit​(int value)
        Sets the specified value to the unit field.
      • set

        public YGValue set​(float value,
                           int unit)
        Initializes this struct with the specified values.
      • set

        public YGValue set​(YGValue src)
        Copies the specified struct data to this struct.
        Parameters:
        src - the source struct
        Returns:
        this struct
      • malloc

        public static YGValue malloc()
        Returns a new YGValue instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static YGValue calloc()
        Returns a new YGValue instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static YGValue create()
        Returns a new YGValue instance allocated with BufferUtils.
      • create

        public static YGValue create​(long address)
        Returns a new YGValue instance for the specified memory address.
      • createSafe

        @Nullable
        public static YGValue createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static YGValue.Buffer malloc​(int capacity)
        Returns a new YGValue.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static YGValue.Buffer calloc​(int capacity)
        Returns a new YGValue.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static YGValue.Buffer create​(int capacity)
        Returns a new YGValue.Buffer instance allocated with BufferUtils.
        Parameters:
        capacity - the buffer capacity
      • create

        public static YGValue.Buffer create​(long address,
                                            int capacity)
        Create a YGValue.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static YGValue.Buffer createSafe​(long address,
                                                int capacity)
        Like create, but returns null if address is NULL.
      • mallocStack

        @Deprecated
        public static YGValue mallocStack()
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static YGValue callocStack()
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • mallocStack

        @Deprecated
        public static YGValue mallocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
      • callocStack

        @Deprecated
        public static YGValue callocStack​(org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
      • mallocStack

        @Deprecated
        public static YGValue.Buffer mallocStack​(int capacity,
                                                 org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
      • callocStack

        @Deprecated
        public static YGValue.Buffer callocStack​(int capacity,
                                                 org.lwjgl.system.MemoryStack stack)
        Deprecated.
        Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
      • malloc

        public static YGValue malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new YGValue instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static YGValue calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new YGValue instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
      • malloc

        public static YGValue.Buffer malloc​(int capacity,
                                            org.lwjgl.system.MemoryStack stack)
        Returns a new YGValue.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static YGValue.Buffer calloc​(int capacity,
                                            org.lwjgl.system.MemoryStack stack)
        Returns a new YGValue.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • nvalue

        public static float nvalue​(long struct)
        Unsafe version of value().
      • nunit

        public static int nunit​(long struct)
        Unsafe version of unit().
      • nvalue

        public static void nvalue​(long struct,
                                  float value)
        Unsafe version of value.
      • nunit

        public static void nunit​(long struct,
                                 int value)
        Unsafe version of unit.