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

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

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

import com.alibaba.fastffi.CXXOperator;
import com.alibaba.fastffi.CXXReference;
import com.alibaba.fastffi.CXXValue;
import com.alibaba.fastffi.FFIForeignType;
import com.alibaba.fastffi.FFIPointerImpl;
import com.alibaba.fastffi.FFISynthetic;
import com.alibaba.fastffi.FFITypeFactory;
import java.lang.Long;
import java.lang.Object;
import java.lang.String;
import java.lang.UnsatisfiedLinkError;

@FFIForeignType(
    value = "std::vector",
    factory = StdVector_cxx_0xe16f6c32Factory.class
)
@FFISynthetic("com.alibaba.fastffi.stdcxx.StdVector")
public class StdVector_cxx_0xe16f6c32 extends FFIPointerImpl implements StdVector {
  public static final int SIZE;

  public static final int HASH_SHIFT;

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

  public StdVector_cxx_0xe16f6c32(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;
    StdVector_cxx_0xe16f6c32 that = (StdVector_cxx_0xe16f6c32) o;
    return this.address == that.address;
  }

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

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

  @CXXReference
  public Long at(int index) {
    return new java.lang.Long(nativeAt(address, index));
  }

  @CXXReference
  public static native long nativeAt(long ptr, int index0);

  public long capacity() {
    return nativeCapacity(address);
  }

  public static native long nativeCapacity(long ptr);

  public void clear() {
    nativeClear(address);
  }

  public static native void nativeClear(long ptr);

  public long data() {
    return nativeData(address);
  }

  public static native long nativeData(long ptr);

  @CXXOperator("delete")
  public void delete() {
    nativeDelete(address);
  }

  @CXXOperator("delete")
  public static native void nativeDelete(long ptr);

  @CXXOperator("[]")
  @CXXReference
  public Long get(int index) {
    return new java.lang.Long(nativeGet(address, index));
  }

  @CXXOperator("[]")
  @CXXReference
  public static native long nativeGet(long ptr, int index0);

  public StdVector.Factory getFactory() {
    return StdVector_cxx_0xe16f6c32Factory.INSTANCE;
  }

  public void push_back(@CXXValue Long e) {
    nativePush_back(address, e);
  }

  public static native void nativePush_back(long ptr, long e0);

  public void reserve(long size) {
    nativeReserve(address, size);
  }

  public static native void nativeReserve(long ptr, long size0);

  public void resize(long size) {
    nativeResize(address, size);
  }

  public static native void nativeResize(long ptr, long size0);

  public long size() {
    return nativeSize(address);
  }

  public static native long nativeSize(long ptr);

  public static native long nativeCreateFactory0();
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy