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

org.lwjgl.util.yoga.YGFree Maven / Gradle / Ivy

There is a newer version: 3.3.5
Show newest version
/*
 * Copyright LWJGL. All rights reserved.
 * License terms: https://www.lwjgl.org/license
 * MACHINE GENERATED FILE, DO NOT EDIT
 */
package org.lwjgl.util.yoga;

import org.lwjgl.system.*;

import static org.lwjgl.system.MemoryUtil.*;

public abstract class YGFree extends Callback implements YGFreeI {

    /** Creates a {@code YGFree} instance from the specified function pointer. */
    public static YGFree create(long functionPointer) {
        if (functionPointer == NULL) {
            return null;
        }

        YGFreeI instance = Callback.get(functionPointer);
        return instance instanceof YGFree
            ? (YGFree)instance
            : new Container(functionPointer, instance);
    }

    /** Creates a {@code YGFree} instance that delegates to the specified {@code YGFreeI} instance. */
    public static YGFree create(YGFreeI instance) {
        return instance instanceof YGFree
            ? (YGFree)instance
            : new Container(instance.address(), instance);
    }

    protected YGFree() {
        super(SIGNATURE);
    }

    private YGFree(long functionPointer) {
        super(functionPointer);
    }

    private static final class Container extends YGFree {

        private final YGFreeI delegate;

        Container(long functionPointer, YGFreeI delegate) {
            super(functionPointer);
            this.delegate = delegate;
        }

        @Override
        public long invoke(long ptr) {
            return delegate.invoke(ptr);
        }

    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy