private final ObjectBuffer getObjectBuffer() { if (objectBuffer == null) { objectBuffer = new ObjectBuffer(); } return objectBuffer; }
void putObject(Object array, int offset, int length, int flags) { ensureSpace(); objects[objectIndex++] = array; info[infoIndex++] = flags; info[infoIndex++] = offset; info[infoIndex++] = length; } }
/** * Adds a java direct buffer as a pointer parameter. * @param buffer The buffer to use as a pointer argument. * @param offset An offset to add to the buffer native address. * @param length The length of the buffer to use. */ public void putDirectBuffer(int index, java.nio.Buffer obj, int offset, int length) { putObject(obj, offset, length, makeBufferFlags(index)); }
/** * Adds a java int array as a pointer parameter. * * @param array The java array to use as the pointer parameter. * @param offset The offset from the start of the array. * @param length The length of the array to use. * @param flags The flags to use (IN, OUT) */ public void putArray(int index, int[] array, int offset, int length, int flags) { putObject(array, offset, length, makeObjectFlags(flags, INT | ARRAY, index)); }
/** * Put the address of the current JNIEnv into this parameter position * * @param index The index of the parameter. */ public void putJNI(int index, Object obj, int type) { putObject(obj, 0, 0, makeJNIFlags(index, type)); }
public final Object invokeObject(Function function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return Foreign.invokeArrayWithObjectsReturnObject(function.contextAddress, function.functionAddress, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()); }
public final void putArray(final float[] array, int offset, int length, int flags) { paramOffset = Encoder.getInstance().skipAddress(paramOffset); getObjectBuffer().putArray(paramIndex++, array, offset, length, flags); }
public static ObjectParameterInfo create(int parameterIndex, ObjectType objectType, ComponentType componentType, int ioflags) { return getCachedInfo(ObjectBuffer.makeObjectFlags(ioflags, objectType.value | componentType.value, parameterIndex)); }
public final void putDirectBuffer(final java.nio.Buffer value, int offset, int length) { paramOffset = Encoder.getInstance().skipAddress(paramOffset); getObjectBuffer().putDirectBuffer(paramIndex++, value, offset, length); }
public final Object invokeObject(Function function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return Foreign.invokeArrayWithObjectsReturnObject(function.contextAddress, function.functionAddress, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()); }
/** * Adds a java short array as a pointer parameter. * * @param array The java array to use as the pointer parameter. * @param offset The offset from the start of the array. * @param length The length of the array to use. * @param flags The flags to use (IN, OUT) */ public void putArray(int index, short[] array, int offset, int length, int flags) { putObject(array, offset, length, makeObjectFlags(flags, SHORT | ARRAY, index)); }
public final void putArray(final double[] array, int offset, int length, int flags) { paramOffset = Encoder.getInstance().skipAddress(paramOffset); getObjectBuffer().putArray(paramIndex++, array, offset, length, flags); }
/** * Put the address of the current JNIEnv into this parameter position * * @param index The index of the parameter. */ public void putJNI(int index, Object obj, int type) { putObject(obj, 0, 0, makeJNIFlags(index, type)); }
public static ObjectParameterInfo create(int parameterIndex, ObjectType objectType, ComponentType componentType, int ioflags) { return getCachedInfo(ObjectBuffer.makeObjectFlags(ioflags, objectType.value | componentType.value, parameterIndex)); }
public final void putDirectBuffer(final java.nio.Buffer value, int offset, int length) { paramOffset = Encoder.getInstance().skipAddress(paramOffset); getObjectBuffer().putDirectBuffer(paramIndex++, value, offset, length); }
public final Object invokeObject(Function function, HeapInvocationBuffer buffer) { ObjectBuffer objectBuffer = buffer.objectBuffer(); return Foreign.invokeArrayWithObjectsReturnObject(function.contextAddress, function.functionAddress, buffer.array(), objectBuffer.objectCount(), objectBuffer.info(), objectBuffer.objects()); }
/** * Adds a java int array as a pointer parameter. * * @param array The java array to use as the pointer parameter. * @param offset The offset from the start of the array. * @param length The length of the array to use. * @param flags The flags to use (IN, OUT) */ public void putArray(int index, int[] array, int offset, int length, int flags) { putObject(array, offset, length, makeObjectFlags(flags, INT | ARRAY, index)); }
public final void putArray(final int[] array, int offset, int length, int flags) { paramOffset = Encoder.getInstance().skipAddress(paramOffset); getObjectBuffer().putArray(paramIndex++, array, offset, length, flags); }
/** * Adds a java direct buffer as a pointer parameter. * @param buffer The buffer to use as a pointer argument. * @param offset An offset to add to the buffer native address. * @param length The length of the buffer to use. */ public void putDirectBuffer(int index, java.nio.Buffer obj, int offset, int length) { putObject(obj, offset, length, makeBufferFlags(index)); }
/** * Put the address of the current JNIEnv into this parameter position * * @param index The index of the parameter. */ public void putJNI(int index, Object obj, int type) { putObject(obj, 0, 0, makeJNIFlags(index, type)); }