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

com.alibaba.fastffi.stdcxx.UniquePtr_cxx_0xcf30570 Maven / Gradle / Ivy

The newest version!
package com.alibaba.fastffi.stdcxx;

import com.alibaba.fastffi.FFIForeignType;
import com.alibaba.fastffi.FFIPointerImpl;
import com.alibaba.fastffi.FFISynthetic;
import com.alibaba.fastffi.FFITypeFactory;
import com.alibaba.fastffi.clang.ASTUnit;
import java.lang.Object;
import java.lang.String;
import java.lang.UnsatisfiedLinkError;

@FFIForeignType("std::unique_ptr")
@FFISynthetic("com.alibaba.fastffi.stdcxx.UniquePtr")
public class UniquePtr_cxx_0xcf30570 extends FFIPointerImpl implements UniquePtr {
  public static final int SIZE;

  public static final int HASH_SHIFT;

  static {
    try {
      System.loadLibrary("llvm4jni");
    } catch (UnsatisfiedLinkError e) {
      System.load(FFITypeFactory.findNativeLibrary(UniquePtr_cxx_0xcf30570.class, "llvm4jni"));
    }
  }
  static {
    SIZE = _elementSize$$$();
    assert SIZE > 0;
    HASH_SHIFT = 31 - Integer.numberOfLeadingZeros(1 + SIZE);
    assert HASH_SHIFT > 0;
  }

  public UniquePtr_cxx_0xcf30570(final long address) {
    super(address);
  }

  private static final native int _elementSize$$$();

  public boolean equals(Object o) {
    if (this == o) return true;
    if (o == null || getClass() != o.getClass()) return false;
    UniquePtr_cxx_0xcf30570 that = (UniquePtr_cxx_0xcf30570) o;
    return this.address == that.address;
  }

  public int hashCode() {
    return (int) (address >> HASH_SHIFT);
  }

  public String toString() {
    return getClass().getName() + "@" + Long.toHexString(address);
  }

  public ASTUnit get() {
    long ret$ = nativeGet(address); return (ret$ == 0L ? null : new com.alibaba.fastffi.clang.ASTUnit_cxx_0x47914e15(ret$));
  }

  public static native long nativeGet(long ptr);

  public ASTUnit release() {
    long ret$ = nativeRelease(address); return (ret$ == 0L ? null : new com.alibaba.fastffi.clang.ASTUnit_cxx_0x47914e15(ret$));
  }

  public static native long nativeRelease(long ptr);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy