Direct-BT  2.3.1
Direct-BT - Direct Bluetooth Programming.
Classes | Namespaces | Macros | Functions
helper_jni.hpp File Reference
#include <vector>
#include <memory>
#include <functional>
#include <jni.h>
#include <jau/java_uplink.hpp>
#include <jau/basic_types.hpp>
#include <jau/darray.hpp>
#include <jau/basic_algos.hpp>
#include <jau/jni/jni_mem.hpp>
Include dependency graph for helper_jni.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  jau::JavaGlobalObj
 Implementation for JavaAnon, by simply wrapping a JNIGlobalRef instance. More...
 

Namespaces

 jau
 

Macros

#define rethrow_and_raise_java_exception_jau(E)   rethrow_and_raise_java_exception_jauimpl((E), __FILE__, __LINE__)
 Re-throw current exception and raise respective java exception using any matching function above. More...
 

Functions

bool jau::java_exception_check (JNIEnv *env, const char *file, int line)
 Return true if a java exception occurred, otherwise false. More...
 
void jau::java_exception_check_and_throw (JNIEnv *env, const char *file, int line)
 Throws a C++ exception if a java exception occurred, otherwise do nothing. More...
 
void jau::print_native_caught_exception_fwd2java (const std::exception &e, const char *file, int line)
 
void jau::print_native_caught_exception_fwd2java (const std::string &msg, const char *file, int line)
 
void jau::print_native_caught_exception_fwd2java (const char *cmsg, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const std::exception &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const std::runtime_error &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const jau::RuntimeException &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const jau::InternalError &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const jau::NullPointerException &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const jau::IllegalArgumentException &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const std::invalid_argument &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const jau::IllegalStateException &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const jau::UnsupportedOperationException &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const jau::IndexOutOfBoundsException &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const std::bad_alloc &e, const char *file, int line)
 
void jau::raise_java_exception (JNIEnv *env, const jau::OutOfMemoryError &e, const char *file, int line)
 
void jau::rethrow_and_raise_java_exception_jauimpl (JNIEnv *env, const char *file, int line)
 Re-throw current exception and raise respective java exception using any matching function above. More...
 
jfieldID jau::getField (JNIEnv *env, jobject obj, const char *field_name, const char *field_signature)
 
jfieldID jau::getInstanceField (JNIEnv *env, jobject obj)
 
jclass jau::search_class (JNIEnv *env, const char *clazz_name)
 
jclass jau::search_class (JNIEnv *env, jobject obj)
 
jclass jau::search_class (JNIEnv *env, JavaUplink &object)
 
jmethodID jau::search_method (JNIEnv *env, jclass clazz, const char *method_name, const char *prototype, bool is_static)
 
jfieldID jau::search_field (JNIEnv *env, jclass clazz, const char *field_name, const char *type, bool is_static)
 
bool jau::from_jboolean_to_bool (jboolean val)
 
std::string jau::from_jstring_to_string (JNIEnv *env, jstring str)
 
jstring jau::from_string_to_jstring (JNIEnv *env, const std::string &str)
 
jobject jau::get_new_arraylist (JNIEnv *env, jsize size, jmethodID *add)
 
template<typename T >
T * jau::getJavaUplinkObject (JNIEnv *env, jobject obj)
 
template<typename T >
T * jau::getJavaUplinkObjectUnchecked (JNIEnv *env, jobject obj)
 
template<typename T >
void jau::setJavaUplinkObject (JNIEnv *env, jobject obj, T *t)
 
template<typename T >
T * jau::castInstance (jlong instance)
 
template<typename T >
T * jau::getObjectRef (JNIEnv *env, jobject obj, const char *field_name)
 
template<typename T >
void jau::setObjectRef (JNIEnv *env, jobject obj, T *t, const char *field_name)
 
template<typename T >
T * jau::getInstance (JNIEnv *env, jobject obj)
 
template<typename T >
T * jau::getInstanceUnchecked (JNIEnv *env, jobject obj)
 
template<typename T >
void jau::setInstance (JNIEnv *env, jobject obj, T *t)
 
void jau::clearInstance (JNIEnv *env, jobject obj)
 
template<typename T >
jobject jau::generic_clone (JNIEnv *env, jobject obj)
 
template<typename T >
jobject jau::convert_instance_to_jobject (JNIEnv *env, T *elem, const char *ctor_prototype, std::function< jobject(JNIEnv *, jclass, jmethodID, T *)> ctor)
 
template<typename T >
jobject jau::convert_vector_sharedptr_to_jarraylist (JNIEnv *env, T &array)
 
template<typename T , typename U >
jobject jau::convert_vector_uniqueptr_to_jarraylist (JNIEnv *env, T &array, const char *ctor_prototype)
 
template<typename T , typename U >
jobject jau::convert_vector_uniqueptr_to_jarraylist (JNIEnv *env, T &array, const char *ctor_prototype, std::function< jobject(JNIEnv *, jclass, jmethodID, U *)> ctor)
 
template<typename T , typename U >
jobject jau::convert_vector_sharedptr_to_jarraylist (JNIEnv *env, T &array, const char *ctor_prototype, std::function< jobject(JNIEnv *, jclass, jmethodID, U *)> ctor)
 

Macro Definition Documentation

◆ rethrow_and_raise_java_exception_jau

#define rethrow_and_raise_java_exception_jau (   E)    rethrow_and_raise_java_exception_jauimpl((E), __FILE__, __LINE__)

Re-throw current exception and raise respective java exception using any matching function above.

Definition at line 102 of file helper_jni.hpp.