8#ifndef META_OCEAN_PLATFORM_ANDROID_SCOPED_JNI_LOCAL_OBJECT_H
9#define META_OCEAN_PLATFORM_ANDROID_SCOPED_JNI_LOCAL_OBJECT_H
22#if defined(OCEAN_DEBUG) || defined(OCEAN_ENABLE_JNI_REFERENCE_VERIFICATION)
23 #define OCEAN_VERIFY_JNI_REFERENCE_THREAD
172 explicit inline operator bool()
const;
222 *
this = std::move(
object);
230#ifdef OCEAN_VERIFY_JNI_REFERENCE_THREAD
241 ocean_assert(scopedJNIEnvironment.
isValid());
243 if (!scopedJNIEnvironment.
isValid())
288 JNIEnv* callingJNIEnvironment =
nullptr;
290 if (
verificationJavaVM_->GetEnv((
void**)(&callingJNIEnvironment), JNI_VERSION_1_6) != JNI_OK)
296 ocean_assert(
false &&
"The thread has been detached, the local reference does not exist anymore!");
306 ocean_assert(
false &&
"The local reference must be released on the thread which has created it!");
352 object.jniEnvironment_ =
nullptr;
353 object.object_ = T();
354 object.verificationJavaVM_ =
nullptr;
static void writeToDebugOutput(const std::string &message)
Writes a message to the most suitable debug output of the current platform.
The namespace covering the entire Ocean framework.
Definition Accessor.h:15