Provides Octave's Java interface.
More...
#include <algorithm>
#include <array>
#include <fstream>
#include <map>
#include <string>
#include <vector>
#include <clocale>
#include "Cell.h"
#include "builtin-defun-decls.h"
#include "cmd-edit.h"
#include "defaults.h"
#include "defun.h"
#include "error.h"
#include "errwarn.h"
#include "file-ops.h"
#include "file-stat.h"
#include "fpucw-wrappers.h"
#include "interpreter.h"
#include "interpreter-private.h"
#include "load-path.h"
#include "lo-sysdep.h"
#include "oct-env.h"
#include "oct-process.h"
#include "oct-shlib.h"
#include "ov-java.h"
#include "variables.h"
#include <jni.h>
Go to the source code of this file.
|
JNIEXPORT jboolean JNICALL | Java_org_octave_Octave_call (JNIEnv *, jclass, jstring, jobjectArray, jobjectArray) |
|
JNIEXPORT void JNICALL | Java_org_octave_Octave_doEvalString (JNIEnv *, jclass, jstring) |
|
JNIEXPORT void JNICALL | Java_org_octave_Octave_doInvoke (JNIEnv *, jclass, jint, jobjectArray) |
|
JNIEXPORT jboolean JNICALL | Java_org_octave_Octave_needThreadedInvokation (JNIEnv *, jclass) |
|
JNIEXPORT void JNICALL | Java_org_octave_OctaveReference_doFinalize (JNIEnv *, jclass, jint) |
|
Provides Octave's Java interface.
Definition in file ov-java.cc.
◆ BOX_PRIMITIVE_ARRAY
#define BOX_PRIMITIVE_ARRAY |
( |
|
JAVA_TYPE, |
|
|
|
JAVA_ID, |
|
|
|
JAVA_TYPE_CAP, |
|
|
|
OCTAVE_ID |
|
) |
| |
Value: cls = jni_env->FindClass (JAVA_ID); \
if (jni_env->IsInstanceOf (jobj, cls)) \
{ \
const JAVA_TYPE ##
Array jarr =
reinterpret_cast<JAVA_TYPE ##
Array> (jobj); \
const jsize
len = jni_env->GetArrayLength (jarr); \
JAVA_TYPE *buffer =
reinterpret_cast<JAVA_TYPE *
> (
d.fortran_vec ()); \
jni_env->Get ## JAVA_TYPE_CAP ## ArrayRegion (jarr, 0,
len, buffer); \
break; \
}
N Dimensional Array with copy-on-write semantics.
Vector representing the dimensions (size) of an Array.
F77_RET_T const F77_DBLE const F77_DBLE F77_DBLE * d
◆ LIBJVM_FILE_NAME
#define LIBJVM_FILE_NAME "libjvm.so" |
◆ TO_JAVA
#define TO_JAVA |
( |
|
obj | ) |
dynamic_cast<octave_java *> ((obj).internal_rep ()) |
◆ TO_JCLASS
#define TO_JCLASS |
( |
|
obj | ) |
reinterpret_cast<jclass> (obj) |
◆ TO_JNIENV
#define TO_JNIENV |
( |
|
env | ) |
reinterpret_cast<JNIEnv *> (env) |
◆ TO_JOBJECT
#define TO_JOBJECT |
( |
|
obj | ) |
reinterpret_cast<jobject> (obj) |
◆ UNBOX_PRIMITIVE_ARRAY
#define UNBOX_PRIMITIVE_ARRAY |
( |
|
METHOD_T, |
|
|
|
OCTAVE_T, |
|
|
|
JAVA_T, |
|
|
|
JAVA_T_CAP |
|
) |
| |
Value: do \
{ \
const OCTAVE_T ##
NDArray v = val.METHOD_T ## array_value (); \
JAVA_T ##
Array jarr = jni_env->New ## JAVA_T_CAP ##
Array (v.numel ()); \
const JAVA_T *jv = reinterpret_cast<const JAVA_T *> (v.data ()); \
jni_env->Set ## JAVA_T_CAP ## ArrayRegion (jarr, 0, v.numel (), jv); \
jobj = reinterpret_cast<jobject> (jarr); \
jcls = jni_env->GetObjectClass (jobj); \
} \
while (0)
◆ UNBOX_PRIMITIVE_SCALAR
#define UNBOX_PRIMITIVE_SCALAR |
( |
|
OCTAVE_T, |
|
|
|
METHOD_T, |
|
|
|
JAVA_T, |
|
|
|
JAVA_CON |
|
) |
| |
Value: do \
{ \
const OCTAVE_T ov = val.METHOD_T ## _value (); \
jclass_ref dcls (jni_env, jni_env->FindClass (JAVA_T)); \
const jfieldID fid = jni_env->GetStaticFieldID (dcls, "TYPE", "Ljava/lang/Class;"); \
const jmethodID mid = jni_env->GetMethodID (dcls, "<init>", JAVA_CON); \
jcls = reinterpret_cast<jclass> (jni_env->GetStaticObjectField (dcls, fid)); \
jobj = jni_env->NewObject (dcls, mid, ov); \
} \
while (0)
◆ jbyteArray_ref
◆ jclass_ref
◆ jdoubleArray_ref
◆ jintArray_ref
◆ JNI_CreateJavaVM_t
typedef jint(JNICALL * JNI_CreateJavaVM_t) (JavaVM **pvm, JNIEnv **penv, void *args) |
◆ JNI_GetCreatedJavaVMs_t
typedef jint(JNICALL * JNI_GetCreatedJavaVMs_t) (JavaVM **pvm, jsize bufLen, jsize *nVMs) |
◆ jobject_ref
◆ jobjectArray_ref
◆ jstring_ref
◆ jthrowable_ref
◆ Java_org_octave_Octave_call()
JNIEXPORT jboolean JNICALL Java_org_octave_Octave_call |
( |
JNIEnv * |
, |
|
|
jclass |
, |
|
|
jstring |
, |
|
|
jobjectArray |
, |
|
|
jobjectArray |
|
|
) |
| |
◆ Java_org_octave_Octave_doEvalString()
JNIEXPORT void JNICALL Java_org_octave_Octave_doEvalString |
( |
JNIEnv * |
, |
|
|
jclass |
, |
|
|
jstring |
|
|
) |
| |
◆ Java_org_octave_Octave_doInvoke()
JNIEXPORT void JNICALL Java_org_octave_Octave_doInvoke |
( |
JNIEnv * |
, |
|
|
jclass |
, |
|
|
jint |
, |
|
|
jobjectArray |
|
|
) |
| |
◆ Java_org_octave_Octave_needThreadedInvokation()
JNIEXPORT jboolean JNICALL Java_org_octave_Octave_needThreadedInvokation |
( |
JNIEnv * |
, |
|
|
jclass |
|
|
) |
| |
◆ Java_org_octave_OctaveReference_doFinalize()
JNIEXPORT void JNICALL Java_org_octave_OctaveReference_doFinalize |
( |
JNIEnv * |
, |
|
|
jclass |
, |
|
|
jint |
|
|
) |
| |
◆ Vdebug_java
◆ Vjava_matrix_autoconversion
bool Vjava_matrix_autoconversion = false |
◆ Vjava_unsigned_autoconversion
bool Vjava_unsigned_autoconversion = true |