VoltAir
|
Smart wrapper around JNIEnv which retains information of how the environment was loaded. More...
Public Member Functions | |
SelfDetachingJNIEnv (SelfDetachingJNIEnv &&value) | |
Move-constructs a SelfDetachingJNIEnv instance, making it use the same JNIEnv that value was using. More... | |
SelfDetachingJNIEnv (SelfDetachingJNIEnv &value)=delete | |
Deleted copy constructor. More... | |
SelfDetachingJNIEnv (const SelfDetachingJNIEnv &value)=delete | |
Deleted copy constructor. More... | |
JNIEnv * | getJNIEnv () const |
Returns underlying JNIEnv pointer. More... | |
JNIEnv & | operator* () |
Returns the dereferenced JNIEnv pointer. More... | |
const JNIEnv & | operator* () const |
Returns a const reference to the JNIEnv pointer. More... | |
JNIEnv * | operator-> () |
Returns the underlying JNIEnv pointer to provide access to its members. More... | |
const JNIEnv * | operator-> () const |
Returns ther underlying JNIEnv pointer to provide access to its const members. More... | |
SelfDetachingJNIEnv & | operator= (SelfDetachingJNIEnv &&value) |
Move assigns value to this SelfDetachingJNIEnv instance. More... | |
SelfDetachingJNIEnv & | operator= (SelfDetachingJNIEnv &value)=delete |
Deleted copy and assign operator. More... | |
SelfDetachingJNIEnv & | operator= (const SelfDetachingJNIEnv &value)=delete |
Deleted copy and assign operator. More... | |
operator bool () const | |
Returns true if the wrapped JNIEnv is not null. More... | |
Static Public Member Functions | |
static SelfDetachingJNIEnv | fromJVM (JavaVM *vm) |
Returns a SelfDetachingJNIEnv wrapper around the current JNIEnv. More... | |
Smart wrapper around JNIEnv which retains information of how the environment was loaded.
If the current thread has attached to a JavaVM, then this wrapper will detach the current thread from the same JavaVM when the wrapper is deleted.
SelfDetachingJNIEnv::SelfDetachingJNIEnv | ( | SelfDetachingJNIEnv && | value | ) |
Move-constructs a SelfDetachingJNIEnv instance, making it use the same JNIEnv that value
was using.
value | SelfDetachingJNIEnv instance to move into this |
|
delete |
Deleted copy constructor.
value | SelfDetachingJNIEnv to copy |
|
delete |
Deleted copy constructor.
value | SelfDetachingJNIEnv to copy |
|
static |
Returns a SelfDetachingJNIEnv wrapper around the current JNIEnv.
This method first tries to load the current JVM environment. If that fails, this method will try attaching to the current JVM thread to load the environment if the vm
is non-null.
JNIEnv* SelfDetachingJNIEnv::getJNIEnv | ( | ) | const |
Returns underlying JNIEnv pointer.
|
inline |
Returns true
if the wrapped JNIEnv is not null.
JNIEnv& SelfDetachingJNIEnv::operator* | ( | ) |
Returns the dereferenced JNIEnv pointer.
const JNIEnv& SelfDetachingJNIEnv::operator* | ( | ) | const |
Returns a const reference to the JNIEnv pointer.
JNIEnv* SelfDetachingJNIEnv::operator-> | ( | ) |
Returns the underlying JNIEnv pointer to provide access to its members.
const JNIEnv* SelfDetachingJNIEnv::operator-> | ( | ) | const |
Returns ther underlying JNIEnv pointer to provide access to its const members.
SelfDetachingJNIEnv& SelfDetachingJNIEnv::operator= | ( | SelfDetachingJNIEnv && | value | ) |
Move assigns value
to this SelfDetachingJNIEnv instance.
value | SelfDetachingJNIEnv instance to move into this |
this
|
delete |
Deleted copy and assign operator.
value | SelfDetachingJNIEnv to copy and assign |
this
|
delete |
Deleted copy and assign operator.
value | SelfDetachingJNIEnv to copy and assign |
this