Ocean
Ocean Base JNI Library

The Ocean Base JNI Library provides a Java Native Interface for Android. More...

Collaboration diagram for Ocean Base JNI Library:

Data Structures

class  Ocean::JNI::BaseJni
 This class implements a base native interface. More...
 

Functions

jboolean Java_com_meta_ocean_base_BaseJni_initialize (JNIEnv *env, jobject javaThis, jstring messageOutputType)
 Java native interface function to initialize the Ocean Framework. More...
 
jboolean Java_com_meta_ocean_base_BaseJni_initializeWithMessageOutput (JNIEnv *env, jobject javaThis, jint messageOutputType, jstring outputFile)
 Java native interface function to initialize the Ocean Framework. More...
 
jboolean Java_com_meta_ocean_base_BaseJni_setCurrentActivity (JNIEnv *env, jobject javaThis, jobject activity)
 Java native interface function to set the current activity. More...
 
jboolean Java_com_meta_ocean_base_BaseJni_forceProcessorCoreNumber (JNIEnv *env, jobject javaThis, jint cores)
 Forces a specific number of processor cores. More...
 
jboolean Java_com_meta_ocean_base_BaseJni_setWorkerPoolCapacity (JNIEnv *env, jobject javaThis, jint capacity)
 Sets or changes the maximal capacity of the worker pool. More...
 
void Java_com_meta_ocean_base_BaseJni_debug (JNIEnv *env, jobject javaThis, jstring message)
 Java native interface function to forward a debug message to the framework. More...
 
void Java_com_meta_ocean_base_BaseJni_information (JNIEnv *env, jobject javaThis, jstring message)
 Java native interface function to forward an information message to the framework. More...
 
void Java_com_meta_ocean_base_BaseJni_warning (JNIEnv *env, jobject javaThis, jstring message)
 Java native interface function to forward an information message to the framework. More...
 
void Java_com_meta_ocean_base_BaseJni_error (JNIEnv *env, jobject javaThis, jstring message)
 Java native interface function to forward an information message to the framework. More...
 
jstring Java_com_meta_ocean_base_BaseJni_popMessages (JNIEnv *env, jobject javaThis)
 Pops all messages that a currently waiting in the message queue. More...
 
void Java_com_meta_ocean_base_BaseJni_exit (JNIEnv *env, jobject javaThis, jint exitValue)
 Exits the application by invoking the exit() command. More...
 

Detailed Description

The Ocean Base JNI Library provides a Java Native Interface for Android.

The library is available on Android platforms only.

Function Documentation

◆ Java_com_meta_ocean_base_BaseJni_debug()

void Java_com_meta_ocean_base_BaseJni_debug ( JNIEnv *  env,
jobject  javaThis,
jstring  message 
)

Java native interface function to forward a debug message to the framework.

Parameters
envThe JNI environment
javaThisThe JNI object
messageThe debug message to forward
See also
Java_com_meta_ocean_base_BaseJni_information().

◆ Java_com_meta_ocean_base_BaseJni_error()

void Java_com_meta_ocean_base_BaseJni_error ( JNIEnv *  env,
jobject  javaThis,
jstring  message 
)

Java native interface function to forward an information message to the framework.

Parameters
envThe JNI environment
javaThisThe JNI object
messageThe error message to forward
See also
Java_com_meta_ocean_NativeInterface_information(), Java_com_meta_ocean_NativeInterface_warning().

◆ Java_com_meta_ocean_base_BaseJni_exit()

void Java_com_meta_ocean_base_BaseJni_exit ( JNIEnv *  env,
jobject  javaThis,
jint  exitValue 
)

Exits the application by invoking the exit() command.

Beware: Commonly Android decides whether an application will be terminated or not so that this function should be a workaround only.

Parameters
envThe JNI environment
javaThisThe JNI object
exitValueThe exit value to be used

◆ Java_com_meta_ocean_base_BaseJni_forceProcessorCoreNumber()

jboolean Java_com_meta_ocean_base_BaseJni_forceProcessorCoreNumber ( JNIEnv *  env,
jobject  javaThis,
jint  cores 
)

Forces a specific number of processor cores.

Parameters
envThe JNI environment
javaThisThe JNI object
coresCPU cores to be forced during initialization
Returns
True, if succeeded

◆ Java_com_meta_ocean_base_BaseJni_information()

void Java_com_meta_ocean_base_BaseJni_information ( JNIEnv *  env,
jobject  javaThis,
jstring  message 
)

Java native interface function to forward an information message to the framework.

Parameters
envThe JNI environment
javaThisThe JNI object
messageThe information message to forward
See also
Java_com_meta_ocean_NativeInterface_warning(), Java_com_meta_ocean_NativeInterface_error().

◆ Java_com_meta_ocean_base_BaseJni_initialize()

jboolean Java_com_meta_ocean_base_BaseJni_initialize ( JNIEnv *  env,
jobject  javaThis,
jstring  messageOutputType 
)

Java native interface function to initialize the Ocean Framework.

Several individual message output types can be specified and combined:

  • "OUTPUT_STANDARD": To write all messages to the standard output (e.g., std::cout on desktop platforms, or Android logcat on Android platforms).
  • "OUTPUT_QUEUED": To queue all messages and to explicitly pop the messages later (e.g., to display messages in a debug window).
  • "<filename>": To write all messages to a define file.
    Parameters
    envThe JNI environment, must be valid
    javaThisThe JNI Base object
    messageOutputTypeThe type of the message output to be used, empty to use 'OUTPUT_STANDARD'
    Returns
    True, if succeeded

◆ Java_com_meta_ocean_base_BaseJni_initializeWithMessageOutput()

jboolean Java_com_meta_ocean_base_BaseJni_initializeWithMessageOutput ( JNIEnv *  env,
jobject  javaThis,
jint  messageOutputType,
jstring  outputFile 
)

Java native interface function to initialize the Ocean Framework.

Parameters
envThe JNI environment, must be valid
javaThisThe JNI Base object
messageOutputTypeThe type of the message output to be used.
outputFileThe name of the file to which messages will be written, 'messageOutputType' must contain 'OUTPUT_FILE', empty otherwise
Returns
True, if succeeded

◆ Java_com_meta_ocean_base_BaseJni_popMessages()

jstring Java_com_meta_ocean_base_BaseJni_popMessages ( JNIEnv *  env,
jobject  javaThis 
)

Pops all messages that a currently waiting in the message queue.

Parameters
envThe JNI environment
javaThisThe JNI object
Returns
The messages that have been popped.

◆ Java_com_meta_ocean_base_BaseJni_setCurrentActivity()

jboolean Java_com_meta_ocean_base_BaseJni_setCurrentActivity ( JNIEnv *  env,
jobject  javaThis,
jobject  activity 
)

Java native interface function to set the current activity.

Parameters
envThe JNI environment, must be valid
javaThisThe JNI Base object
activityThe current activity to be set or updated, can be nullptr to remove the previously set activity
Returns
True, if succeeded

◆ Java_com_meta_ocean_base_BaseJni_setWorkerPoolCapacity()

jboolean Java_com_meta_ocean_base_BaseJni_setWorkerPoolCapacity ( JNIEnv *  env,
jobject  javaThis,
jint  capacity 
)

Sets or changes the maximal capacity of the worker pool.

Parameters
envThe JNI environment
javaThisThe JNI object
capacityThe maximal number of worker objects the worker pool may provide
Returns
True, if succeeded

◆ Java_com_meta_ocean_base_BaseJni_warning()

void Java_com_meta_ocean_base_BaseJni_warning ( JNIEnv *  env,
jobject  javaThis,
jstring  message 
)

Java native interface function to forward an information message to the framework.

Parameters
envThe JNI environment
javaThisThe JNI object
messageThe warning message to forward
See also
Java_com_meta_ocean_NativeInterface_information(), Java_com_meta_ocean_NativeInterface_error().